Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .clab/ci-topology.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
name: napalm-ci_cd

mgmt:
network: clab_mgmt
ipv4-subnet: 172.20.20.0/24
ipv6-subnet: 2001:172:20:20::/64

topology:
kinds:
srl:
Expand Down
20 changes: 14 additions & 6 deletions napalm_srl/srl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2874,15 +2874,23 @@ def _decodeVal(self, val):
)

def _dictToList(self, aDict):
for key in aDict.keys():
keys_to_update = {}
keys_to_delete = []

for key in list(aDict.keys()): # Use list() to avoid modifying during iteration
if key.startswith("___"):
aDict[key[3:]] = [
keys_to_update[key[3:]] = [
self._dictToList(val) if isinstance(val, dict) else val
for val in aDict[key].values()
]
del aDict[key]
else:
if isinstance(aDict[key], dict):
aDict[key] = self._dictToList(aDict[key])
keys_to_delete.append(key) # Mark for deletion
elif isinstance(aDict[key], dict):
aDict[key] = self._dictToList(aDict[key])

# Apply updates outside the loop
aDict.update(keys_to_update)
for key in keys_to_delete:
del aDict[key]

return aDict