diff options
author | Robert Collins <rbtcollins@hp.com> | 2014-03-06 11:01:50 +1300 |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2014-03-06 12:38:34 +1300 |
commit | 1879dc0800e8015e201f4698c1214a0e525f7ee3 (patch) | |
tree | 0fec6571ac973db57a088293a28d0d8cf93e6a3a /tripleo_heat_merge | |
parent | 9df35c186f14d3b3b76a3946981ad6ec5cf9336f (diff) |
Fix Merge::Map for scatter-gather in Configs.
When Merge::Map was used like so:
NovaCompute0Config:
Merge::Map:
NovaCompute0:
Fn:....
We were adjusting the inner NovaCompute0 to the current scaling loop
position rather than exploding it out as part of the map. For now, we
want maps to be global in context so the fix is fortunately simple.
Change-Id: Ibea723d4c763f593d934a9d2acfd31ce369f6408
Diffstat (limited to 'tripleo_heat_merge')
-rw-r--r-- | tripleo_heat_merge/merge.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tripleo_heat_merge/merge.py b/tripleo_heat_merge/merge.py index 0de27e24..4571d289 100644 --- a/tripleo_heat_merge/merge.py +++ b/tripleo_heat_merge/merge.py @@ -33,9 +33,12 @@ def apply_scaling(template, scaling, in_copies=None): Values are handled via scale_value. - Keys in dicts are always copied per the scaling rule. + Keys in dicts are copied per the scaling rule. Values are either replaced or copied depending on whether the given scaling rule is in in_copies. + + in_copies is reset to None when a dict {'Merge::Map': someobject} is + encountered. """ in_copies = dict(in_copies or {}) # Shouldn't be needed but to avoid unexpected side effects/bugs we short @@ -43,6 +46,8 @@ def apply_scaling(template, scaling, in_copies=None): if not scaling: return template if isinstance(template, dict): + if 'Merge::Map' in template: + in_copies = None new_template = {} for key, value in template.items(): for prefix, copy_num, new_key in scale_value( |