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
This commit is contained in:
James Slagle 2018-06-04 15:59:22 -04:00
parent 07528b07b2
commit 82df65cdcc
2 changed files with 26 additions and 4 deletions

View File

@ -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.

View File

@ -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 <yaml file or directory>' % 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