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
This commit is contained in:
James Slagle 2018-03-20 08:52:37 -04:00
parent 0bf8943f05
commit a134b717dd
2 changed files with 21 additions and 6 deletions

View File

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

View File

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