def __init__(self, conf, map_name=None, automount_mountpoint=None): if map_name is None: map_name = config.MAP_GROUP super(FilesGroupMapHandler, self).__init__(conf, map_name, automount_mountpoint=automount_mountpoint) self.map_parser = file_formats.FilesGroupMapParser()
def testReadGroupEntry(self): """We correctly parse a typical entry in /etc/group format.""" parser = file_formats.FilesGroupMapParser() file_entry = 'root:x:0:zero_cool,acid_burn' map_entry = parser._ReadEntry(file_entry) self.assertEqual(map_entry.name, 'root') self.assertEqual(map_entry.passwd, 'x') self.assertEqual(map_entry.gid, 0) self.assertEqual(map_entry.members, ['zero_cool', 'acid_burn'])
def GetParser(self): """Returns a MapParser to parse FilesGroup cache.""" return file_formats.FilesGroupMapParser()