From a134b717dd787a5b6e28dc401260e22e77ef2162 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Tue, 20 Mar 2018 08:52:37 -0400 Subject: [PATCH] Add validation for SoftwareConfig outputs SoftwareConfig/StructuredConfig outputs aren't supported with config-download given that Heat doesn't know what the output values will since Ansible is applying all configuration after the stack is complete. This validation will report a warning whenever it finds use of outputs on these resource types. After config-download is the default and the Heat driven method is no longer supported, we can switch this warning to an error. Change-Id: I44d5ee3bab3d05ab0a59261d15ea915c75b35713 --- ...-config-outputs-used-8abcb673da6d373f.yaml | 6 ++++++ tools/yaml-validate.py | 21 +++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/validate-no-config-outputs-used-8abcb673da6d373f.yaml diff --git a/releasenotes/notes/validate-no-config-outputs-used-8abcb673da6d373f.yaml b/releasenotes/notes/validate-no-config-outputs-used-8abcb673da6d373f.yaml new file mode 100644 index 0000000000..6e276332b5 --- /dev/null +++ b/releasenotes/notes/validate-no-config-outputs-used-8abcb673da6d373f.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - The use of outputs with Heat SoftwareConfig or StructuredConfig resources + is now deprecated as they are no longer supported with config-download. + Resources that depend on outputs and their values should be changed to use + composable services with external_deploy_tasks or deploy_steps_tasks. diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 5dcb6da091..baf012ce9b 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -170,6 +170,10 @@ DEPLOYMENT_RESOURCE_TYPES = [ 'OS::Heat::StructuredDeployment', 'OS::TripleO::SoftwareDeployment' ] +CONFIG_RESOURCE_TYPES = [ + 'OS::Heat::SoftwareConfig', + 'OS::Heat::StructuredConfig' +] VALID_ANSIBLE_UPGRADE_TAGS = [ 'common', 'validation', 'pre-upgrade' ] @@ -940,12 +944,17 @@ def validate(filename, param_map): resources = tpl.get('resources') if resources: for resource, data in resources.items(): - if data['type'] not in DEPLOYMENT_RESOURCE_TYPES: - continue - if 'name' not in data['properties']: - print('ERROR: resource %s from %s missing name property.' - % (resource, filename)) - return 1 + if data['type'] in DEPLOYMENT_RESOURCE_TYPES: + if 'name' not in data['properties']: + print('ERROR: resource %s from %s missing name property.' + % (resource, filename)) + return 1 + + elif data['type'] in CONFIG_RESOURCE_TYPES: + if 'outputs' in data['properties'] and args.quiet < 2: + print('Warning: resource %s from %s uses Heat outputs ' + 'which are not supported with config-download.' + % (resource, filename)) return retval