示例#1
0
文件: files.py 项目: townie/nsscache
 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()
示例#2
0
    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)
示例#3
0
 def GetParser(self):
     """Returns a MapParser to parse FilesShadow cache."""
     return file_formats.FilesShadowMapParser()