コード例 #1
0
 def get_groups(self):
     try:
         with self.open('/etc/group', 'r') as source:
             return util.parse_groups(
                 [line.rstrip('\n') for line in source])
     except OSError as err:
         raise error.ExecError("Reading /etc/group failed.")
コード例 #2
0
ファイル: need_guestfs.py プロジェクト: xii/xii
    def guest_get_groups(self):
        """get groups from image

        Parse `/etc/group` of the used image

        Returns:
            List of groups
        """
        content = self.guest().cat('/etc/group').split("\n")
        return util.parse_groups(content)
コード例 #3
0
    def guest_get_groups(self):
        """get groups from image

        Parse `/etc/group` of the used image

        Returns:
            List of groups
        """
        content = self.guest().cat('/etc/group').split("\n")
        return util.parse_groups(content)
コード例 #4
0
ファイル: local.py プロジェクト: xii/xii
 def get_groups(self):
     try:
         with self.open('/etc/group', 'r') as source:
             return util.parse_groups([line.rstrip('\n') for line in source])
     except OSError:
         raise error.ExecError("Reading /etc/group failed.")
コード例 #5
0
 def guest_get_groups(self):
     content = self.guest().cat('/etc/group').split("\n")
     return util.parse_groups(content)
コード例 #6
0
ファイル: ssh.py プロジェクト: xii/xii
 def get_groups(self):
     with self.open("/etc/group") as source:
         return util.parse_groups([line.rstrip('\n') for line in source])