Commit e7abb4a5 by Őry Máté

vm: make save_as.shutdown abortable

parent 40c82261
...@@ -240,6 +240,7 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -240,6 +240,7 @@ class SaveAsTemplateOperation(InstanceOperation):
Template can be shared with groups and users. Template can be shared with groups and users.
Users can instantiate Virtual Machines from Templates. Users can instantiate Virtual Machines from Templates.
""") """)
abortable = True
@staticmethod @staticmethod
def _rename(name): def _rename(name):
...@@ -252,11 +253,11 @@ class SaveAsTemplateOperation(InstanceOperation): ...@@ -252,11 +253,11 @@ class SaveAsTemplateOperation(InstanceOperation):
return "%s v%d" % (name, v) return "%s v%d" % (name, v)
def _operation(self, activity, user, system, timeout=300, def _operation(self, activity, user, system, timeout=300,
with_shutdown=True, **kwargs): with_shutdown=True, task=None, **kwargs):
if with_shutdown: if with_shutdown:
try: try:
ShutdownOperation(self.instance).call(parent_activity=activity, ShutdownOperation(self.instance).call(parent_activity=activity,
user=user) user=user, task=task)
except Instance.WrongStateError: except Instance.WrongStateError:
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment