Skip to content

Commit

Permalink
fix populate_device_vars call from init
Browse files Browse the repository at this point in the history
  • Loading branch information
indy-independence committed Nov 28, 2024
1 parent 36d7025 commit d4e8589
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cnaas_nms/devicehandler/init_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def init_access_device_step1(
"secondary_mgmt_gw": secondary_mgmt_gw_ipif.ip,
}
)
device_variables = populate_device_vars(session, dev, new_hostname, DeviceType.ACCESS)
device_variables = populate_device_vars(None, session, dev, new_hostname, DeviceType.ACCESS)
device_variables = {**device_variables, **mgmt_variables}
# Update device state
old_hostname = dev.hostname
Expand Down Expand Up @@ -747,7 +747,7 @@ def init_fabric_device_step1(
"infra_ip": str(infra_ip),
}

device_variables = populate_device_vars(session, dev, new_hostname, devtype)
device_variables = populate_device_vars(None, session, dev, new_hostname, devtype)
device_variables = {**device_variables, **mgmt_variables}
# Update device state
dev.hostname = new_hostname
Expand Down
1 change: 1 addition & 0 deletions src/cnaas_nms/devicehandler/sync_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ def populate_device_vars(
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"])
Expand Down

0 comments on commit d4e8589

Please sign in to comment.