summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-03-06 01:45:46 +0000
committerGerrit Code Review <review@openstack.org>2014-03-06 01:45:46 +0000
commitc12483397cd1483ebe09a422477ac42a32bd9005 (patch)
tree02fa61722fb4695d4512c724ffe7d9424b9a2d8e
parente533f2ac2c9faf18ff1c612722bf38ef37158c46 (diff)
parent1879dc0800e8015e201f4698c1214a0e525f7ee3 (diff)
Merge "Fix Merge::Map for scatter-gather in Configs."
-rw-r--r--examples/scale_map_result.yaml132
-rw-r--r--tripleo_heat_merge/merge.py7
2 files changed, 138 insertions, 1 deletions
diff --git a/examples/scale_map_result.yaml b/examples/scale_map_result.yaml
index 5fa02291..c4617835 100644
--- a/examples/scale_map_result.yaml
+++ b/examples/scale_map_result.yaml
@@ -66,6 +66,50 @@ Resources:
- NovaCompute0
- show
- local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute1
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute1
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute1
+ - show
+ - local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute2
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute2
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute2
+ - show
+ - local
os-collect-config:
cfn:
access_key_id:
@@ -126,6 +170,28 @@ Resources:
- Fn::Select:
- ctlplane
- Fn::GetAtt:
+ - NovaCompute0
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute0
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute0
+ - show
+ - local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
- NovaCompute1
- networks
- Fn::Select:
@@ -141,6 +207,28 @@ Resources:
- NovaCompute1
- show
- local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute2
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute2
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute2
+ - show
+ - local
os-collect-config:
cfn:
access_key_id:
@@ -201,6 +289,50 @@ Resources:
- Fn::Select:
- ctlplane
- Fn::GetAtt:
+ - NovaCompute0
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute0
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute0
+ - show
+ - local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
+ - NovaCompute1
+ - networks
+ - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute1
+ - show
+ - Fn::Join:
+ - .
+ - - Fn::Select:
+ - name
+ - Fn::GetAtt:
+ - NovaCompute1
+ - show
+ - local
+ - Fn::Join:
+ - ' '
+ - - Fn::Select:
+ - 0
+ - Fn::Select:
+ - ctlplane
+ - Fn::GetAtt:
- NovaCompute2
- networks
- Fn::Select:
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(