DeployIdentifier should be provided for any parameter actions

DeployIdentifier is update during the deployment workflow in the
tripleo_common, but all the parameter update and get workflows,
before the depoloyment will fail since the parameter is not provided
for the heat stack validation. Adding a dummy entry for the DeployIdentifier
in the tripleoclient which will be replaced to a timestamp in the
deploy workflow.
Closes-Bug: #1759326

Change-Id: I26cc11895a376788d8aad41727676bec73a15d69
This commit is contained in:
Saravanan KR 2018-05-21 15:00:30 +05:30
parent e9a6843040
commit 4cb7a22529
2 changed files with 12 additions and 3 deletions

View File

@ -165,6 +165,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'DeployIdentifier': 123456789,
'UpdateIdentifier': '',
'StackAction': 'UPDATE',
'DeployIdentifier': '',
}
def _custom_create_params_env(_self, parameters, tht_root,
@ -285,7 +286,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'OvercloudControlFlavor': 'oooq_control',
'OvercloudControllerFlavor': 'oooq_control',
'StackAction': 'CREATE',
'UpdateIdentifier': ''}}
'UpdateIdentifier': '',
'DeployIdentifier': ''}}
mock_rm = shutil.rmtree = mock.MagicMock()
self.cmd.take_action(parsed_args)
@ -441,6 +443,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'DeployIdentifier': 123456789,
'UpdateIdentifier': '',
'StackAction': 'CREATE',
'DeployIdentifier': '',
}
testcase = self
@ -577,7 +580,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
def _custom_create_params_env(_self, parameters, tht_root,
container_name):
testcase.assertTrue('DeployIdentifier' not in parameters)
testcase.assertTrue(parameters['DeployIdentifier'] == '')
parameter_defaults = {"parameter_defaults": parameters}
return parameter_defaults
@ -1118,7 +1121,8 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
parameters_env = {
'parameter_defaults': {
'StackAction': 'UPDATE',
'UpdateIdentifier': ''}}
'UpdateIdentifier': '',
'DeployIdentifier': ''}}
reg_env = {
'parameter_defaults': {
'rhel_reg_activation_key': 'super-awesome-key',
@ -1572,6 +1576,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
'UpdateIdentifier': '',
'StackAction': 'CREATE',
'NtpServer': 'ntp',
'DeployIdentifier': '',
}
def _custom_create_params_env(_self, parameters, tht_root,

View File

@ -69,6 +69,10 @@ class DeployOvercloud(command.Command):
stack_is_new = stack is None
# *Identifier will be update to timestamp value during the deploy
# workflow, but till then for all heat stack validations, we need
# and entry for starting the deploy action.
parameters['DeployIdentifier'] = ''
parameters['UpdateIdentifier'] = ''
parameters['StackAction'] = 'CREATE' if stack_is_new else 'UPDATE'