summaryrefslogtreecommitdiff
path: root/iotronic/objects/service.py
diff options
context:
space:
mode:
Diffstat (limited to 'iotronic/objects/service.py')
-rw-r--r--iotronic/objects/service.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/iotronic/objects/service.py b/iotronic/objects/service.py
index b894e4b..0b1c3a8 100644
--- a/iotronic/objects/service.py
+++ b/iotronic/objects/service.py
@@ -21,11 +21,8 @@ from iotronic.db import api as db_api
21from iotronic.objects import base 21from iotronic.objects import base
22from iotronic.objects import utils as obj_utils 22from iotronic.objects import utils as obj_utils
23 23
24""" 24
25ACTIONS = ['ServiceCall', 'ServiceStop', 'ServiceStart', 25ACTIONS = ['ServiceEnable', 'ServiceDisable', 'ServiceRestore']
26 'ServiceStatus', 'ServiceReboot']
27CUSTOM_PARAMS = ['ServiceCall', 'ServiceStart', 'ServiceReboot']
28NO_PARAMS = ['ServiceStatus']
29 26
30 27
31def is_valid_action(action): 28def is_valid_action(action):
@@ -34,16 +31,6 @@ def is_valid_action(action):
34 return True 31 return True
35 32
36 33
37def want_customs_params(action):
38 return True if action in CUSTOM_PARAMS else False
39
40
41def want_params(action):
42 return False if action in NO_PARAMS else True
43
44"""
45
46
47class Service(base.IotronicObject): 34class Service(base.IotronicObject):
48 # Version 1.0: Initial version 35 # Version 1.0: Initial version
49 VERSION = '1.0' 36 VERSION = '1.0'
@@ -154,6 +141,7 @@ class Service(base.IotronicObject):
154 object, e.g.: Service(context) 141 object, e.g.: Service(context)
155 142
156 """ 143 """
144
157 values = self.obj_get_changes() 145 values = self.obj_get_changes()
158 db_service = self.dbapi.create_service(values) 146 db_service = self.dbapi.create_service(values)
159 self._from_db_object(self, db_service) 147 self._from_db_object(self, db_service)