예제 #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.")
예제 #2
0
파일: need_guestfs.py 프로젝트: xii/xii
    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)
예제 #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)
예제 #4
0
파일: local.py 프로젝트: 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.")
예제 #5
0
 def guest_get_users(self):
     content = self.guest().cat('/etc/passwd').split("\n")
     return util.parse_passwd(content)
예제 #6
0
파일: ssh.py 프로젝트: xii/xii
 def get_users(self):
     with self.open("/etc/passwd") as source:
         return util.parse_passwd([line.rstrip('\n') for line in source])