Finish to use constants to define partition states

parent 8c964853
......@@ -70,6 +70,8 @@ MANDATORY_PARAMETER_LIST = [
]
COMPUTER_PARTITION_DESTROYED_STATE = 'destroyed'
COMPUTER_PARTITION_STARTED_STATE = 'started'
COMPUTER_PARTITION_STOPPED_STATE = 'stopped'
# Global variables about return state of slapgrid
SLAPGRID_SUCCESS = 0
......@@ -773,13 +775,13 @@ class Slapgrid(object):
buildout=self.buildout)
computer_partition_state = computer_partition.getState()
if computer_partition_state == "started":
if computer_partition_state == COMPUTER_PARTITION_STARTED_STATE:
local_partition.install()
computer_partition.available()
local_partition.start()
self._checkPromises(computer_partition)
computer_partition.started()
elif computer_partition_state == "stopped":
elif computer_partition_state == COMPUTER_PARTITION_STOPPED_STATE:
try:
local_partition.install()
computer_partition.available()
......
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 to comment