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.

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 ef5bf9deb8
commit 5ae6367d03
3 changed files with 11 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

@ -50,6 +50,7 @@ workflows:
- queue_name: tripleo
- generate_passwords: true
- use_default_templates: false
- validate_stack: true
tags:
- tripleo-common-managed
@ -132,6 +133,7 @@ workflows:
action: tripleo.parameters.update
input:
container: <% $.container %>
validate: <% $.validate_stack %>
parameters:
RootStackName: <% $.container %>
on-success: container_images_prepare
@ -248,6 +250,7 @@ workflows:
- queue_name: tripleo
- generate_passwords: true
- plan_environment: null
- validate_stack: true
tags:
- tripleo-common-managed
tasks:
@ -299,6 +302,7 @@ workflows:
get_url_parm: SwiftRingGetTempurl
put_url_parm: SwiftRingPutTempurl
use_default_templates: true
validate_stack: <% $.validate_stack %>
create_ceph_ansible_fetch_directory_backup_plan:
workflow: tripleo.swift_backup.v1.create_swift_backup_container_plan

View File

@ -15,6 +15,7 @@ workflows:
- swift_tar: "swift-rings.tar.gz"
- get_url_parm: SwiftRingGetTempurl
- put_url_parm: SwiftRingPutTempurl
- validate_stack: true
tags:
- tripleo-common-managed
tasks:
@ -51,6 +52,7 @@ workflows:
input:
parameters: <% {$.put_url_parm => task(put_tempurl).result} %>
container: <% $.container %>
validate: <% $.validate_stack %>
on-success: set_status_success
on-error: set_put_tempurl_failed