Fixed merge code populating properties from yaml.
authordivakar-padiyar-nandavar <divakar.padiyar-nandavar@hp.com>
Thu, 8 Aug 2013 13:57:43 +0000 (07:57 -0600)
committerdivakar-padiyar-nandavar <divakar.padiyar-nandavar@hp.com>
Thu, 8 Aug 2013 14:09:13 +0000 (08:09 -0600)
Fixed merge code populating properties from yaml files which was
setting only Type attribute for certain attribues related to Image
For example, default value for notcomputeImage is populated properly
in overcloud.yaml

Fixes bug #1202884

Change-Id: I9ea270dd19e9ebdb997be5d07b04ee2df28e3721

merge.py

index 768ae42..2004408 100644 (file)
--- a/merge.py
+++ b/merge.py
@@ -79,6 +79,7 @@ for template_path in templates:
     for r, rbody in sorted(new_resources.items()):
         if rbody['Type'] == 'AWS::EC2::Instance':
             # XXX Assuming ImageId is always a Ref
+            ikey_val = end_template['Parameters'][rbody['Properties']['ImageId']['Ref']]
             del end_template['Parameters'][rbody['Properties']['ImageId']['Ref']]
             role = rbody.get('Metadata', {}).get('OpenStack::Role', r)
             role = translate_role(role)
@@ -102,7 +103,7 @@ for template_path in templates:
             end_template['Resources'][role] = rbody
             ikey = '%sImage' % (role)
             end_template['Resources'][role]['Properties']['ImageId'] = {'Ref': ikey}
-            end_template['Parameters'][ikey] = {'Type': 'String'}
+            end_template['Parameters'][ikey] = ikey_val
         elif rbody['Type'] == 'FileInclude':
             with open(rbody['Path']) as rfile:
                 include_content = yaml.safe_load(rfile.read())