Commit af0882f5 by Bach Dániel

Merge branch 'feature-improved-recovery' into 'master'

Feature improved recovery

See merge request !254
parents 4392ed39 fb838841
...@@ -1181,14 +1181,28 @@ class RecoverOperation(InstanceOperation): ...@@ -1181,14 +1181,28 @@ class RecoverOperation(InstanceOperation):
except Instance.InstanceDestroyedError: except Instance.InstanceDestroyedError:
pass pass
def _operation(self): def _operation(self, user, activity):
with activity.sub_activity(
readable_name=ugettext_noop("recover instance")):
self.instance.destroyed_at = None
for disk in self.instance.disks.all(): for disk in self.instance.disks.all():
disk.destroyed = None disk.destroyed = None
disk.restore() disk.restore()
self.instance.destroyed_at = None self.instance.status = 'PENDING'
if self.instance.template:
for net in self.instance.template.interface_set.all():
parent_activity=activity, user=user, vlan=net.vlan)
@register_operation @register_operation
class ResourcesOperation(InstanceOperation): class ResourcesOperation(InstanceOperation):
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