Deprecate Role and ImageBuilder metadata handling
authorTomas Sedovic <tsedovic@redhat.com>
Wed, 25 Jun 2014 13:03:16 +0000 (15:03 +0200)
committerTomas Sedovic <tsedovic@redhat.com>
Wed, 10 Sep 2014 09:30:15 +0000 (11:30 +0200)
Our templates and elements no longer depend on `OpenStack::Role` or
`OpenStack::ImageBuilder::Elements` metadata. Using either now prints out a
deprecation warning.

Change-Id: I91e79b00bacca8caf13d4b6fa83d90e9c20b241c

tripleo_heat_merge/merge.py

index 49aee6f..b5bec0f 100644 (file)
@@ -332,6 +332,9 @@ def merge(templates, master_role=None, slave_roles=None,
                         # XXX Assuming ImageId is always a Ref
                         ikey_val = end_template[lang.parameters][rbody[lang.properties][image_key][lang.get_param]]
                         del end_template[lang.parameters][rbody[lang.properties][image_key][lang.get_param]]
+                if 'OpenStack::Role' in rbody.get(lang.metadata, {}):
+                    sys.stderr.write("WARNING: OpenStack::Role is deprecated"
+                                     " and will be removed in a later release\n");
                 role = rbody.get(lang.metadata, {}).get('OpenStack::Role', r)
                 role = translate_role(role, master_role, slave_roles)
                 if role != r:
@@ -342,6 +345,10 @@ def merge(templates, master_role=None, slave_roles=None,
                         if m in end_template[lang.resources][role].get(lang.metadata, {}):
                             if m == 'OpenStack::ImageBuilder::Elements':
                                 end_template[lang.resources][role][lang.metadata][m].extend(mbody)
+                                sys.stderr.write(
+                                    "WARNING: OpenStack::ImageBuilder::Elements"
+                                    " is deprecated and will be removed in a"
+                                    " later release\n");
                                 continue
                             if mbody != end_template[lang.resources][role][lang.metadata][m]:
                                 errors.append('Role %s metadata key %s conflicts.' %