Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ca19599
authored
Mar 09, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: make is_console_available into property
parent
e1a0492c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
circle/vm/models/instance.py
+4
-3
No files found.
circle/vm/models/instance.py
View file @
9ca19599
...
@@ -273,6 +273,10 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -273,6 +273,10 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
return
" "
.
join
([
s
for
s
in
parts
if
s
!=
""
])
return
" "
.
join
([
s
for
s
in
parts
if
s
!=
""
])
@property
@property
def
is_console_available
(
self
):
return
self
.
is_running
@property
def
is_running
(
self
):
def
is_running
(
self
):
return
self
.
state
==
'RUNNING'
return
self
.
state
==
'RUNNING'
...
@@ -298,9 +302,6 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -298,9 +302,6 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
else
:
else
:
return
act
.
resultant_state
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
):
def
manual_state_change
(
self
,
new_state
,
reason
=
None
,
user
=
None
):
# TODO cancel concurrent activity (if exists)
# TODO cancel concurrent activity (if exists)
act
=
InstanceActivity
.
create
(
code_suffix
=
'manual_state_change'
,
act
=
InstanceActivity
.
create
(
code_suffix
=
'manual_state_change'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment