Add FileInclude special type.
We need to be able to combine pieces without uploading bits to an accessible URL. Change-Id: If0cec8ce7c77fed786d54dd0af2eb7823c088920
This commit is contained in:
parent
36b4e49819
commit
aebad8ce24
7
merge.py
7
merge.py
@ -87,6 +87,13 @@ for template_path in templates:
|
||||
ikey = '%sImage' % (role)
|
||||
end_template['Resources'][role]['Properties']['ImageId'] = {'Ref': ikey}
|
||||
end_template['Parameters'][ikey] = {'Type': 'String'}
|
||||
elif rbody['Type'] == 'FileInclude':
|
||||
with open(rbody['Path']) as rfile:
|
||||
include_content = yaml.safe_load(rfile.read())
|
||||
subkeys = rbody.get('SubKey','').split('.')
|
||||
while len(subkeys) and subkeys[0]:
|
||||
include_content = include_content[subkeys.pop(0)]
|
||||
end_template['Resources'][r] = include_content
|
||||
else:
|
||||
if r in end_template.get('Resources', {}):
|
||||
if rbody != end_template['Resources'][r]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user