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
This commit is contained in:
parent
9df35c186f
commit
1879dc0800
@ -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:
|
||||
@ -120,6 +164,28 @@ Resources:
|
||||
|
||||
'
|
||||
- - Fn::Join:
|
||||
- ' '
|
||||
- - Fn::Select:
|
||||
- 0
|
||||
- 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
|
||||
@ -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:
|
||||
@ -195,6 +283,50 @@ Resources:
|
||||
|
||||
'
|
||||
- - Fn::Join:
|
||||
- ' '
|
||||
- - Fn::Select:
|
||||
- 0
|
||||
- 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
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user