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
28867629
authored
Sep 24, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add OFFLINE state for disabled non-online nodes
parent
13efc315
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
circle/vm/models/node.py
+4
-2
No files found.
circle/vm/models/node.py
View file @
28867629
...
@@ -135,7 +135,8 @@ class Node(OperatedMixin, TimeStampedModel):
...
@@ -135,7 +135,8 @@ class Node(OperatedMixin, TimeStampedModel):
warn
(
'Use Node.info["core_num"]'
,
DeprecationWarning
)
warn
(
'Use Node.info["core_num"]'
,
DeprecationWarning
)
return
self
.
info
[
'core_num'
]
return
self
.
info
[
'core_num'
]
STATES
=
{
None
:
(
'MISSING'
,
_
(
'missing'
)),
STATES
=
{
None
:
({
True
:
(
'MISSING'
,
_
(
'missing'
)),
False
:
(
'OFFLINE'
,
_
(
'offline'
))}),
False
:
{
False
:
(
'DISABLED'
,
_
(
'disabled'
))},
False
:
{
False
:
(
'DISABLED'
,
_
(
'disabled'
))},
True
:
{
False
:
(
'PASSIVE'
,
_
(
'passive'
)),
True
:
{
False
:
(
'PASSIVE'
,
_
(
'passive'
)),
True
:
(
'ACTIVE'
,
_
(
'active'
))}}
True
:
(
'ACTIVE'
,
_
(
'active'
))}}
...
@@ -146,7 +147,7 @@ class Node(OperatedMixin, TimeStampedModel):
...
@@ -146,7 +147,7 @@ class Node(OperatedMixin, TimeStampedModel):
if
self
.
online
:
if
self
.
online
:
return
self
.
STATES
[
self
.
enabled
][
self
.
schedule_enabled
]
return
self
.
STATES
[
self
.
enabled
][
self
.
schedule_enabled
]
else
:
else
:
return
self
.
STATES
[
None
]
return
self
.
STATES
[
None
]
[
self
.
enabled
]
def
get_status_display
(
self
):
def
get_status_display
(
self
):
return
self
.
_get_state
()[
1
]
return
self
.
_get_state
()[
1
]
...
@@ -303,6 +304,7 @@ class Node(OperatedMixin, TimeStampedModel):
...
@@ -303,6 +304,7 @@ class Node(OperatedMixin, TimeStampedModel):
def
get_status_icon
(
self
):
def
get_status_icon
(
self
):
return
{
return
{
'DISABLED'
:
'times-circle-o'
,
'DISABLED'
:
'times-circle-o'
,
'OFFLINE'
:
'times-circle'
,
'MISSING'
:
'fa-warning'
,
'MISSING'
:
'fa-warning'
,
'PASSIVE'
:
'fa-play-circle-o'
,
'PASSIVE'
:
'fa-play-circle-o'
,
'ACTIVE'
:
'fa-play-circle'
}
.
get
(
self
.
get_state
(),
'ACTIVE'
:
'fa-play-circle'
}
.
get
(
self
.
get_state
(),
...
...
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