Use shared logic for executing upgrade

now that it's part of the handler
This commit is contained in:
Lance Edgar 2017-08-17 18:16:28 -05:00
parent 639644375d
commit 2db9d31386

View file

@ -326,17 +326,9 @@ class UpgradeView(MasterView):
def execute_instance(self, upgrade, user, **kwargs):
session = orm.object_session(upgrade)
upgrade.executing = True
upgrade.status_code = self.enum.UPGRADE_STATUS_EXECUTING
self.handler.mark_executing(upgrade)
session.commit()
result = self.handler.execute(upgrade, user, **kwargs)
upgrade.executing = False
if result:
upgrade.status_code = self.enum.UPGRADE_STATUS_SUCCEEDED
else:
upgrade.status_code = self.enum.UPGRADE_STATUS_FAILED
upgrade.executed = make_utc()
upgrade.executed_by = user
self.handler.do_execute(upgrade, user, **kwargs)
def execute_progress(self):
upgrade = self.get_instance()