From d1d829e6aceba61532041d8499dc4ffd8055fbc2 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 8 Jul 2014 12:14:28 +1200 Subject: merge.py --hot to process and generate HOT This adds a --hot flag to merge.py which will assume source templates are in the HOT format, and generate a HOT template artifact. Tests have also been ported to HOT, along with some minor corrections to the existing tests to make the source and result templates valid heat templates. Partial-Blueprint: tripleo-juno-remove-mergepy Change-Id: If18ff79f89456123c884a1ab2f910ce4cc9a6e0b --- tripleo_heat_merge/merge.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tripleo_heat_merge') diff --git a/tripleo_heat_merge/merge.py b/tripleo_heat_merge/merge.py index d919d02c..077bcb1c 100644 --- a/tripleo_heat_merge/merge.py +++ b/tripleo_heat_merge/merge.py @@ -23,6 +23,25 @@ class Cfn(object): get_attr = 'Fn::GetAtt' +class Hot(object): + + base_template = { + 'heat_template_version': '2013-05-23', + 'description': [] + } + get_resource = 'get_resource' + get_param = 'get_param' + description = 'description' + parameters = 'parameters' + outputs = 'outputs' + resources = 'resources' + type = 'type' + properties = 'properties' + metadata = 'metadata' + depends_on = 'depends_on' + get_attr = 'get_attr' + + lang = Cfn() @@ -241,7 +260,15 @@ def main(argv=None): help="Change parameters in templates to match resource names. This was " " the default at one time but it causes issues when parameter " " names need to remain stable.") + parser.add_argument( + '--hot', action='store_true', default=False, + help="Assume source templates are in the HOT format, and generate a " + "HOT template artifact.") args = parser.parse_args(argv) + if args.hot: + global lang + lang = Hot() + templates = args.templates scaling = parse_scaling(args.scale) merged_template = merge(templates, args.master_role, args.slave_roles, -- cgit 1.2.3-korg