Skip to content

Commit ca6056a

Browse files
SteveMacenskienricosutera
authored andcommitted
allowing leaf key rewrites that aren't dcits (ros-navigation#3730)
Signed-off-by: enricosutera <[email protected]>
1 parent 3bd2896 commit ca6056a

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)