Commit e5276242 by Bach Dániel

vm: fix ResetNodeOperation

Closes #390
parent cb4e68fd
...@@ -1093,16 +1093,17 @@ class ResetNodeOperation(NodeOperation): ...@@ -1093,16 +1093,17 @@ class ResetNodeOperation(NodeOperation):
"You cannot reset a disabled or online node."), Exception()) "You cannot reset a disabled or online node."), Exception())
def _operation(self, activity, user): def _operation(self, activity, user):
if self.node.enabled:
DisableOperation(self.node).call(parent_activity=activity,
user=user)
for i in self.node.instance_set.all(): for i in self.node.instance_set.all():
name = create_readable(ugettext_noop( name = create_readable(ugettext_noop(
"migrate %(instance)s (%(pk)s)"), instance=i.name, pk=i.pk) "redeploy %(instance)s (%(pk)s)"), instance=i.name, pk=i.pk)
with activity.sub_activity('migrate_instance_%d' % i.pk, with activity.sub_activity('migrate_instance_%d' % i.pk,
readable_name=name): readable_name=name):
i.redeploy(user=user) i.redeploy(user=user)
self.node.enabled = False
self.node.schedule_enabled = False
self.node.save()
@register_operation @register_operation
class FlushOperation(NodeOperation): class FlushOperation(NodeOperation):
......
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