Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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):
num_cores
=
property
(
get_num_cores
)
STATES
=
{
False
:
{
False
:
(
'OFFLINE'
,
_
(
'offline'
)),
True
:
(
'DISABLED'
,
_
(
'disabled'
))},
True
:
{
False
:
(
'MISSING'
,
_
(
'missing'
)),
True
:
(
'ONLINE'
,
_
(
'online'
))}}
@property
def
state
(
self
):
"""The state combined of online and enabled attributes.
"""
if
self
.
enabled
and
self
.
online
:
return
'ONLINE'
elif
self
.
enabled
and
not
self
.
online
:
return
'MISSING'
elif
not
self
.
enabled
and
self
.
online
:
return
'DISABLED'
else
:
return
'OFFLINE'
return
self
.
STATES
[
self
.
enabled
][
self
.
online
][
0
]
def
get_status_display
(
self
):
return
self
.
STATES
[
self
.
enabled
][
self
.
online
][
1
]
def
disable
(
self
,
user
=
None
):
''' 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