Skip to content

Commit 7b1a75a

Browse files
committed
allowing leaf key rewrites that aren't dcits (#3730)
1 parent e87fc13 commit 7b1a75a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nav2_common/nav2_common/launch/rewritten_yaml.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,13 @@ def updateYamlPathVals(self, yaml, yaml_key_list, rewrite_val):
136136

137137
def substitute_keys(self, yaml, key_rewrites):
138138
if len(key_rewrites) != 0:
139-
for key, val in yaml.items():
140-
if isinstance(val, dict) and key in key_rewrites:
139+
for key in list(yaml.keys()):
140+
val = yaml[key]
141+
if key in key_rewrites:
141142
new_key = key_rewrites[key]
142143
yaml[new_key] = yaml[key]
143144
del yaml[key]
145+
if isinstance(val, dict):
144146
self.substitute_keys(val, key_rewrites)
145147

146148
def getYamlLeafKeys(self, yamlData):

0 commit comments

Comments
 (0)