Commit 1ea56dfd by Kálmán Viktor

vm: fix vm state changed to XY on None message

parent cb2d9cff
Pipeline #81 passed with stage
in 0 seconds
...@@ -447,12 +447,17 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin, ...@@ -447,12 +447,17 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
if new_node is False: # None would be a valid value if new_node is False: # None would be a valid value
new_node = self.node new_node = self.node
# log state change # log state change
if new_node:
msg = ugettext_noop("vm state changed to %(state)s on %(node)s")
else:
msg = ugettext_noop("vm state changed to %(state)s")
try: try:
act = InstanceActivity.create( act = InstanceActivity.create(
code_suffix='vm_state_changed', code_suffix='vm_state_changed',
readable_name=create_readable( readable_name=create_readable(msg, state=new_state,
ugettext_noop("vm state changed to %(state)s on %(node)s"), node=new_node),
state=new_state, node=new_node),
instance=self) instance=self)
except ActivityInProgressError: except ActivityInProgressError:
pass # discard state change if another activity is in progress. pass # discard state change if another activity is in progress.
......
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