[US449915] NC 1.0 - Fixing CMS Heat Template for Ocata
Change-Id: I5ef61ae240d1d86fd6130db1014348dc9fe08d2b
This commit is contained in:
committed by
Aaron McLean
parent
242640c855
commit
c7be34dfb1
@@ -41,20 +41,6 @@ def create_final_yaml(title, description, resources, outputs):
|
||||
return yamldata
|
||||
|
||||
|
||||
def _create_metadata_yaml(alldata):
|
||||
metadata = {}
|
||||
metadata_items = {}
|
||||
for item in alldata['metadata']:
|
||||
metadata_items.update(item)
|
||||
metadata['tenant_metadata'] = {'type': 'OS::Keystone::Metadata\n',
|
||||
'properties': {
|
||||
'TENANT_ID': "{'get_resource': '%s'}" %
|
||||
alldata['uuid'],
|
||||
'METADATA': {
|
||||
'metadata': metadata_items}}}
|
||||
return metadata
|
||||
|
||||
|
||||
def _metadata_to_tags(metadata):
|
||||
|
||||
return '[' + ','.join(
|
||||
@@ -87,21 +73,15 @@ def yamlbuilder(alldata, region):
|
||||
outputs['outputs'] = {}
|
||||
resources['resources'] = {}
|
||||
|
||||
if region['rangerAgentVersion'] >= 4.0:
|
||||
resources['resources']["%s" % alldata['uuid']] =\
|
||||
{'type': 'OS::Keystone::Project\n',
|
||||
'properties': {'name': "%s" % project_name,
|
||||
'description': project_description,
|
||||
'tags': _metadata_to_tags(alldata['metadata']),
|
||||
'enabled': status}}
|
||||
else:
|
||||
resources['resources']["%s" % alldata['uuid']] =\
|
||||
{'type': 'OS::Keystone::Project2\n',
|
||||
'properties': {'name': "%s" % project_name,
|
||||
'project_id': alldata['uuid'],
|
||||
'description': project_description,
|
||||
'enabled': status}}
|
||||
# create the output
|
||||
resources['resources']["%s" % alldata['uuid']] =\
|
||||
{'type': 'OS::Keystone::Project\n',
|
||||
'properties': {'name': "%s" % project_name,
|
||||
'project_id': alldata['uuid'],
|
||||
'description': project_description,
|
||||
'tags': _metadata_to_tags(alldata['metadata']),
|
||||
'enabled': status}}
|
||||
|
||||
# create the output
|
||||
outputs['outputs']["%s_id" % alldata['uuid']] =\
|
||||
{"value": {"get_resource": "%s" % alldata['uuid']}}
|
||||
|
||||
@@ -160,10 +140,6 @@ def yamlbuilder(alldata, region):
|
||||
adjust_quota_resource = CMSAdjustResource(region['rangerAgentVersion'])
|
||||
adjust_quota_resource.fix_quota_resource_item(alldata['uuid'], quotas, resources, options)
|
||||
|
||||
if region['rangerAgentVersion'] < 4.0:
|
||||
metadata = _create_metadata_yaml(alldata)
|
||||
resources['resources'].update(metadata)
|
||||
|
||||
# putting all parts together for full yaml
|
||||
yamldata = create_final_yaml(title, description, resources, outputs)
|
||||
logger.debug(
|
||||
@@ -192,8 +168,8 @@ class CMSAdjustResource(object):
|
||||
|
||||
self.adjust_quota_parameters(ite, items[item])
|
||||
|
||||
# adding tenant to each quota
|
||||
items[item]['tenant'] = \
|
||||
# adding project to each quota
|
||||
items[item]['project'] = \
|
||||
"{'get_resource': %s}" % uuid
|
||||
resources['resources'][options[item][0]] = \
|
||||
{"type": options[item][1], "properties": items[item]}
|
||||
|
||||
Reference in New Issue
Block a user