Have the remove action inherit from the uninstall one.

Instead of repeating similar items in the remove action
just inherit from the uninstall one and activate the
uninstall action and then the remove action when triggered
since removing is also an uninstall.

Change-Id: I9419a2b3b0108e01f6412264fb9021ce23c7023d
This commit is contained in:
Joshua Harlow
2013-06-18 22:44:45 -07:00
parent f357ac47fb
commit 90e8f60da0

View File

@@ -18,21 +18,15 @@ from anvil import colorizer
from anvil import log
from anvil.actions import base as action
from anvil.actions import uninstall
LOG = log.getLogger(__name__)
class RemoveAction(action.Action):
@property
def lookup_name(self):
return 'uninstall'
def _order_components(self, components):
components = super(RemoveAction, self)._order_components(components)
components.reverse()
return components
class RemoveAction(uninstall.UninstallAction):
def _run(self, persona, component_order, instances):
super(RemoveAction, self)._run(persona, component_order, instances)
removals = ['package-install', 'install']
dependency_handler_class = self.distro.dependency_handler_class
dependency_handler = dependency_handler_class(self.distro,