Example #1
0
 def get_users(self):
     try:
         with self.open('/etc/passwd', 'r') as source:
             return util.parse_passwd(
                 [line.rstrip('\n') for line in source])
     except OSError as err:
         raise error.ExecError("Reading /etc/passwd failed.")
Example #2
0
    def guest_get_users(self):
        """get users from image

        Parse `/etc/passwd` of the used image

        Returns:
            Dict of users
        """
        content = self.guest().cat('/etc/passwd').split("\n")
        return util.parse_passwd(content)
Example #3
0
    def guest_get_users(self):
        """get users from image

        Parse `/etc/passwd` of the used image

        Returns:
            Dict of users
        """
        content = self.guest().cat('/etc/passwd').split("\n")
        return util.parse_passwd(content)
Example #4
0
File: local.py Project: xii/xii
 def get_users(self):
     try:
         with self.open('/etc/passwd', 'r') as source:
             return util.parse_passwd([line.rstrip('\n') for line in source])
     except OSError:
         raise error.ExecError("Reading /etc/passwd failed.")
Example #5
0
 def guest_get_users(self):
     content = self.guest().cat('/etc/passwd').split("\n")
     return util.parse_passwd(content)
Example #6
0
File: ssh.py Project: xii/xii
 def get_users(self):
     with self.open("/etc/passwd") as source:
         return util.parse_passwd([line.rstrip('\n') for line in source])