From 82df65cdccb044b7c6a0fb03809f1d3f3d80d695 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Mon, 4 Jun 2018 15:59:22 -0400 Subject: [PATCH] Fail yaml-validate.py on new deployments with outputs Elevates the warning from yaml-validate.py about Heat deployment outputs to an error now that config-download is the default. An exclusions list is added to exclude those existing templates that use outputs, which will be cleaned up in the Stein release. Change-Id: I7249df36cb9391d8577432920a9bd33361a58f92 --- ...t-deployment-outputs-1377270acbc5bc7e.yaml | 5 ++++ tools/yaml-validate.py | 25 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/error-on-new-heat-deployment-outputs-1377270acbc5bc7e.yaml diff --git a/releasenotes/notes/error-on-new-heat-deployment-outputs-1377270acbc5bc7e.yaml b/releasenotes/notes/error-on-new-heat-deployment-outputs-1377270acbc5bc7e.yaml new file mode 100644 index 0000000000..144467844c --- /dev/null +++ b/releasenotes/notes/error-on-new-heat-deployment-outputs-1377270acbc5bc7e.yaml @@ -0,0 +1,5 @@ +--- +other: + - New Heat deployments that use outputs will now cause an error by + yaml-validate.py as these do not work with config-download. Existing + deployments with outputs are excluded. diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index 92a3e2fa0c..b4e135e204 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -284,6 +284,14 @@ ANSIBLE_TASKS_YAMLS = [ './extraconfig/pre_network/boot_param_tasks.yaml' ] +HEAT_OUTPUTS_EXCLUSIONS = [ + './puppet/extraconfig/tls/ca-inject.yaml', + './puppet/extraconfig/tls/tls-cert-inject.yaml', + './deployed-server/deployed-server.yaml', + './extraconfig/tasks/ssh/host_public_key.yaml', + './extraconfig/pre_network/host_config_and_reboot.yaml' +] + def exit_usage(): print('Usage %s ' % sys.argv[0]) sys.exit(1) @@ -1106,10 +1114,19 @@ def validate(filename, param_map): 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)) + if 'outputs' in data['properties']: + if filename in HEAT_OUTPUTS_EXCLUSIONS \ + and args.quiet < 2: + print('Warning: resource %s from %s uses Heat ' + 'outputs which are not supported with ' + 'config-download.' + % (resource, filename)) + else: + print('ERROR: resource %s from %s uses Heat ' + 'outputs which are not supported with ' + 'config-download.' + % (resource, filename)) + return 1 return retval