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.")
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)
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.")
def guest_get_groups(self): content = self.guest().cat('/etc/group').split("\n") return util.parse_groups(content)
def get_groups(self): with self.open("/etc/group") as source: return util.parse_groups([line.rstrip('\n') for line in source])