Skip to content

Commit

Permalink
allowing leaf key rewrites that aren't dcits (#3730)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMacenski committed Aug 2, 2023
1 parent 6e63952 commit afda75f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nav2_common/nav2_common/launch/rewritten_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ def updateYamlPathVals(self, yaml, yaml_key_list, rewrite_val):

def substitute_keys(self, yaml, key_rewrites):
if len(key_rewrites) != 0:
for key, val in yaml.items():
if isinstance(val, dict) and key in key_rewrites:
for key in list(yaml.keys()):
val = yaml[key]
if key in key_rewrites:
new_key = key_rewrites[key]
yaml[new_key] = yaml[key]
del yaml[key]
if isinstance(val, dict):
self.substitute_keys(val, key_rewrites)

def getYamlLeafKeys(self, yamlData):
Expand Down

0 comments on commit afda75f

Please sign in to comment.