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
Commit
8f58c693
authored
Feb 14, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node: added activity to enable and disable
parent
8e1889e5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
circle/vm/models/node.py
+15
-0
No files found.
circle/vm/models/node.py
View file @
8f58c693
...
@@ -16,6 +16,8 @@ from firewall.models import Host
...
@@ -16,6 +16,8 @@ from firewall.models import Host
from
..tasks
import
vm_tasks
from
..tasks
import
vm_tasks
from
.common
import
Trait
from
.common
import
Trait
from
.activity
import
node_activity
from
monitor.calvin.calvin
import
Query
from
monitor.calvin.calvin
import
Query
from
monitor.calvin.calvin
import
GraphiteHandler
from
monitor.calvin.calvin
import
GraphiteHandler
...
@@ -79,6 +81,19 @@ class Node(TimeStampedModel):
...
@@ -79,6 +81,19 @@ class Node(TimeStampedModel):
return
'disabled'
return
'disabled'
else
:
else
:
return
'offline'
return
'offline'
return
'Offline'
def
disable
(
self
,
user
=
None
):
''' Disable the node.'''
with
node_activity
(
code_suffix
=
'disable'
,
node
=
self
,
user
=
user
):
self
.
enabled
=
False
self
.
save
()
def
enable
(
self
,
user
=
None
):
''' Enable the node. '''
with
node_activity
(
code_suffix
=
'enable'
,
node
=
self
,
user
=
user
):
self
.
enabled
=
True
self
.
save
()
@property
@property
@method_cache
(
300
)
@method_cache
(
300
)
...
...
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