Use shared logic for executing upgrade
now that it's part of the handler
This commit is contained in:
parent
639644375d
commit
2db9d31386
|
@ -326,17 +326,9 @@ class UpgradeView(MasterView):
|
||||||
|
|
||||||
def execute_instance(self, upgrade, user, **kwargs):
|
def execute_instance(self, upgrade, user, **kwargs):
|
||||||
session = orm.object_session(upgrade)
|
session = orm.object_session(upgrade)
|
||||||
upgrade.executing = True
|
self.handler.mark_executing(upgrade)
|
||||||
upgrade.status_code = self.enum.UPGRADE_STATUS_EXECUTING
|
|
||||||
session.commit()
|
session.commit()
|
||||||
result = self.handler.execute(upgrade, user, **kwargs)
|
self.handler.do_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
|
|
||||||
|
|
||||||
def execute_progress(self):
|
def execute_progress(self):
|
||||||
upgrade = self.get_instance()
|
upgrade = self.get_instance()
|
||||||
|
|
Loading…
Reference in a new issue