Don't always validate heat stack when adding parameters

There are certain cases we add parameters to plan environment
when creating and updating a plan. As part of that action we
aslo try to validate the stack/template. However, validation
would fail, if we've resource mappings in user-environment that
are not merged/added to the plan yet.

This adds new input flag to plan create and update workflows which
can then be changed in python-tripleoclient, so as not to imapct the
UI workflows.

Also includes I56258428d7a9461af64055a5605f3227bfadda2f that fixes
some issues with this patch on master.

Conflicts:
	workbooks/plan_management.yaml
	workbooks/swift_backup.yaml

Change-Id: I9c54379925339eaaa9a0ee61cb823bddc95737c7
Partial-Bug: #1817539
(cherry picked from commit 762bf8c9e7)
This commit is contained in:
Rabi Mishra 2019-02-21 17:34:17 +05:30
parent 889a09c87c
commit e5207aedee
2 changed files with 8 additions and 2 deletions

View File

@ -127,11 +127,13 @@ class UpdateParametersAction(templates.ProcessTemplatesAction):
def __init__(self, parameters,
container=constants.DEFAULT_CONTAINER_NAME,
key=constants.DEFAULT_PLAN_ENV_KEY):
key=constants.DEFAULT_PLAN_ENV_KEY,
validate=True):
super(UpdateParametersAction, self).__init__()
self.container = container
self.parameters = parameters
self.key = key
self.validate = validate
def run(self, context):
swift = self.get_object_client(context)
@ -164,8 +166,9 @@ class UpdateParametersAction(templates.ProcessTemplatesAction):
if isinstance(processed_data, actions.Result):
return processed_data
processed_data['show_nested'] = True
env = plan_utils.get_env(swift, self.container)
if not self.validate:
return env
params = env.get('parameter_defaults')
fields = {

View File

@ -64,6 +64,7 @@ workflows:
- queue_name: tripleo
- generate_passwords: true
- use_default_templates: false
- validate_stack: true
tags:
- tripleo-common-managed
@ -129,6 +130,7 @@ workflows:
action: tripleo.parameters.update
input:
container: <% $.container %>
validate: <% $.validate_stack %>
parameters:
RootStackName: <% $.container %>
on-success: container_images_prepare
@ -219,6 +221,7 @@ workflows:
- queue_name: tripleo
- generate_passwords: true
- plan_environment: null
- validate_stack: true
tags:
- tripleo-common-managed
tasks: