Skip to content

Commit b5fee13

Browse files
committed
Fix a bug doubling module name prefix
1 parent b32898d commit b5fee13

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

awscli/customizations/cloudformation/module_maps.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ def vf(v):
161161

162162

163163
def getatt_map_list(getatt):
164-
"Converts a getatt array like ['Content[]', 'Arn'] to a string"
164+
"""
165+
Converts a getatt array like ['Content[]', 'Arn'] to a string,
166+
joining with a dot. 'Content[].Arn'
167+
Returns None if the getatt is not a list at least 2 elements long,
168+
and if the first element does not contain '[]'
169+
"""
165170
if isinstance(getatt, list) and len(getatt) > 1:
166171
if "[]" in getatt[0]:
167172
return ".".join(getatt) # Content[].Arn

awscli/customizations/cloudformation/modules.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
# pylint: disable=fixme,too-many-instance-attributes,too-many-lines
2828

29+
import copy
2930
import logging
3031
import os
3132

@@ -587,8 +588,8 @@ def resolve_output_getatt(self, v, d, n):
587588
if s is not None and s in self.mapped:
588589
# Special handling for Overrides that GetAtt a module
589590
# property, when that module has a Map attribute
590-
d[n] = self.mapped[s]
591-
if isinstance(d[n], list):
591+
if isinstance(self.mapped[s], list):
592+
d[n] = copy.deepcopy(self.mapped[s])
592593
for item in d[n]:
593594
if GETATT in item and len(item[GETATT]) > 0:
594595
item[GETATT][0] = self.name + item[GETATT][0]

0 commit comments

Comments
 (0)