Commit 8f58c693 by Guba Sándor

node: added activity to enable and disable

parent 8e1889e5
......@@ -16,6 +16,8 @@ from firewall.models import Host
from ..tasks import vm_tasks
from .common import Trait
from .activity import node_activity
from monitor.calvin.calvin import Query
from monitor.calvin.calvin import GraphiteHandler
......@@ -79,6 +81,19 @@ class Node(TimeStampedModel):
return 'disabled'
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
def enable(self, user=None):
''' Enable the node. '''
with node_activity(code_suffix='enable', node=self, user=user):
self.enabled = True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment