Action Plan state - Changed STARTING to TRIGGERED
As the STARTING state was not clear on its meaning, I renamed it to TRIGGERED. Change-Id: I99cceeb57f3d7d42c1543b21fad88a6872bc4e55 Closes-Bug: #1533245
This commit is contained in:
@@ -386,7 +386,8 @@ class ActionPlansController(rest.RestController):
|
||||
if action_plan_to_update[field] != patch_val:
|
||||
action_plan_to_update[field] = patch_val
|
||||
|
||||
if field == 'state' and patch_val == 'STARTING':
|
||||
if (field == 'state'
|
||||
and patch_val == objects.action_plan.State.TRIGGERED):
|
||||
launch_action_plan = True
|
||||
|
||||
action_plan_to_update.save()
|
||||
|
||||
@@ -77,6 +77,7 @@ from watcher.objects import utils as obj_utils
|
||||
|
||||
class State(object):
|
||||
RECOMMENDED = 'RECOMMENDED'
|
||||
TRIGGERED = 'TRIGGERED'
|
||||
ONGOING = 'ONGOING'
|
||||
FAILED = 'FAILED'
|
||||
SUCCEEDED = 'SUCCEEDED'
|
||||
|
||||
@@ -419,7 +419,7 @@ class TestPatch(api_base.FunctionalTest):
|
||||
def test_replace_ok_state_starting(self):
|
||||
with mock.patch.object(aapi.ApplierAPI,
|
||||
'launch_action_plan') as applier_mock:
|
||||
new_state = 'STARTING'
|
||||
new_state = objects.action_plan.State.TRIGGERED
|
||||
response = self.get_json(
|
||||
'/action_plans/%s' % self.action_plan.uuid)
|
||||
self.assertNotEqual(new_state, response['state'])
|
||||
|
||||
Reference in New Issue
Block a user