def update_unmodified(self, finished_proposals): "records the md5 if it matches the one of the file in the fs" finished_filepaths = set((proposal.get_file_path() for proposal in finished_proposals)) expected_md5s = PortageInterface.get_md5_from_vdb(finished_filepaths) for (path, expected_md5) in expected_md5s.iteritems(): EtcProposalConfigFile(path).update_unmodified(expected_md5) for path in (finished_filepaths - set(expected_md5s.keys())): EtcProposalConfigFile(path).clear_unmodified()
def runTest(self): """Testing vdb access""" nonexsistantfile = '/some nonexsistant file' issue = '/etc/issue' hostname = '/etc/conf.d/hostname' files = set([issue, hostname, nonexsistantfile]) md5s = PortageInterface.get_md5_from_vdb(files) self.failIf(md5s.has_key(nonexsistantfile), 'Found an entry in the pkgdb that shouldnt be there: "%s".' % nonexsistantfile ) self.failUnless(md5s.has_key(issue), 'Didnt find an entry in the pkgdb: "%s"' % issue) self.failUnless(md5s.has_key(hostname), 'Didnt find an entry in the pkgdb: "%s"' % hostname)