Skip to content

Commit a84bd61

Browse files
hotfix(inventory): avoid ValueError for empty device list in get_device_id_by_address
1 parent 553cb26 commit a84bd61

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/videoipath_automation_tool/apps/inventory/inventory_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def get_device_id_by_address(self, address: str, include_alt_addresses: bool = T
555555

556556
response = self.vip_connector.rest.get(url)
557557

558-
if response.data and response.data["config"]["devman"]["devices"]["_items"]:
558+
if response.data and isinstance(response.data["config"]["devman"]["devices"]["_items"], list):
559559
devices = response.data["config"]["devman"]["devices"]["_items"]
560560
else:
561561
raise ValueError("Response data is empty.")

0 commit comments

Comments
 (0)