Let ExcuseFinder create migration items

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent 6dde43a339
commit d9f9c6d4a9
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -741,15 +741,15 @@ class Britney(object):
self.logger.info("Update Excuses generation started")
mi_factory = self._migration_item_factory
excusefinder = ExcuseFinder(self.options, self.suite_info, self.all_binaries,
self.pkg_universe, self._policy_engine, self.hints)
self.pkg_universe, self._policy_engine, mi_factory, self.hints)
excuses, upgrade_me = excusefinder.find_actionable_excuses()
self.excuses = excuses
# sort the list of candidates
mi_factory = self._migration_item_factory
self.upgrade_me = sorted(mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in upgrade_me)
self.upgrade_me = sorted(upgrade_me)
self.upgrade_me.extend(old_libraries(mi_factory, self.suite_info, self.options.outofsync_arches))
# write excuses to the output file

@ -12,12 +12,13 @@ from britney2.utils import (invalidate_excuses, find_smooth_updateable_binaries,
class ExcuseFinder(object):
def __init__(self, options, suite_info, all_binaries, pkg_universe, policy_engine, hints):
def __init__(self, options, suite_info, all_binaries, pkg_universe, policy_engine, mi_factory, hints):
self.options = options
self.suite_info = suite_info
self.all_binaries = all_binaries
self.pkg_universe = pkg_universe
self._policy_engine = policy_engine
self._migration_item_factory = mi_factory
self.hints = hints
self.excuses = {}
@ -653,4 +654,7 @@ class ExcuseFinder(object):
e.addreason(deptype.get_reason())
invalidate_excuses(excuses, actionable_items, unconsidered)
mi_factory = self._migration_item_factory
actionable_items = {mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in actionable_items}
return excuses, actionable_items

Loading…
Cancel
Save