Skip to content

Commit

Permalink
Merge branch 'develop' into feature.extendprecommit
Browse files Browse the repository at this point in the history
  • Loading branch information
Josephine.Rutten committed Dec 3, 2024
2 parents 7e52b03 + d4e8589 commit a83cea3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/cnaas_nms/devicehandler/sync_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@ def populate_device_vars(task, session, dev: Device, ztp_hostname: Optional[str]
raise RepoStructureException("File {} not found in template repo".format(mapfile))
with open(mapfile, "r") as f:
mapping = yaml.safe_load(f)
if "unmanaged_config_sections" in mapping[devtype.name] and type(mapping[devtype.name]["unmanaged_config_sections"]) is list:
if (
"unmanaged_config_sections" in mapping[devtype.name]
and type(mapping[devtype.name]["unmanaged_config_sections"]) is list
and task
):
task.host.open_connection("napalm", configuration=task.nornir.config)
res = task.run(task=napalm_get, getters=["config"])
task.host.close_connection("napalm")
Expand Down

0 comments on commit a83cea3

Please sign in to comment.