def __init__(self, conf, map_name=None, automount_mountpoint=None): if map_name is None: map_name = config.MAP_SHADOW super(FilesShadowMapHandler, self).__init__(conf, map_name, automount_mountpoint=automount_mountpoint) self.map_parser = file_formats.FilesShadowMapParser()
def testReadShadowEntry(self): """We correctly parse a typical entry in /etc/shadow format.""" parser = file_formats.FilesShadowMapParser() file_entry = 'root:$1$zomgmd5support:::::::' map_entry = parser._ReadEntry(file_entry) self.assertEqual(map_entry.name, 'root') self.assertEqual(map_entry.passwd, '$1$zomgmd5support') self.assertEqual(map_entry.lstchg, None) self.assertEqual(map_entry.min, None) self.assertEqual(map_entry.max, None) self.assertEqual(map_entry.warn, None) self.assertEqual(map_entry.inact, None) self.assertEqual(map_entry.expire, None) self.assertEqual(map_entry.flag, None)
def GetParser(self): """Returns a MapParser to parse FilesShadow cache.""" return file_formats.FilesShadowMapParser()