Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8b39c899
authored
Mar 15, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add Node.get_status_display
parent
41f26955
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
circle/vm/models/node.py
+9
-8
No files found.
circle/vm/models/node.py
View file @
8b39c899
...
@@ -77,18 +77,19 @@ class Node(TimeStampedModel):
...
@@ -77,18 +77,19 @@ class Node(TimeStampedModel):
num_cores
=
property
(
get_num_cores
)
num_cores
=
property
(
get_num_cores
)
STATES
=
{
False
:
{
False
:
(
'OFFLINE'
,
_
(
'offline'
)),
True
:
(
'DISABLED'
,
_
(
'disabled'
))},
True
:
{
False
:
(
'MISSING'
,
_
(
'missing'
)),
True
:
(
'ONLINE'
,
_
(
'online'
))}}
@property
@property
def
state
(
self
):
def
state
(
self
):
"""The state combined of online and enabled attributes.
"""The state combined of online and enabled attributes.
"""
"""
if
self
.
enabled
and
self
.
online
:
return
self
.
STATES
[
self
.
enabled
][
self
.
online
][
0
]
return
'ONLINE'
elif
self
.
enabled
and
not
self
.
online
:
def
get_status_display
(
self
):
return
'MISSING'
return
self
.
STATES
[
self
.
enabled
][
self
.
online
][
1
]
elif
not
self
.
enabled
and
self
.
online
:
return
'DISABLED'
else
:
return
'OFFLINE'
def
disable
(
self
,
user
=
None
):
def
disable
(
self
,
user
=
None
):
''' Disable the node.'''
''' Disable the node.'''
...
...
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