Commit 9ca19599 by Dudás Ádám

vm: make is_console_available into property

parent e1a0492c
......@@ -273,6 +273,10 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
return " ".join([s for s in parts if s != ""])
@property
def is_console_available(self):
return self.is_running
@property
def is_running(self):
return self.state == 'RUNNING'
......@@ -298,9 +302,6 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
else:
return act.resultant_state
def is_console_available(self):
return self.state in ('RUNNING', )
def manual_state_change(self, new_state, reason=None, user=None):
# TODO cancel concurrent activity (if exists)
act = InstanceActivity.create(code_suffix='manual_state_change',
......
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