diff --git a/changes/413.fixed b/changes/413.fixed new file mode 100644 index 000000000..ba2502a7f --- /dev/null +++ b/changes/413.fixed @@ -0,0 +1 @@ +Fixed method of retrieving objects from IPFabric's technology categories. diff --git a/nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py b/nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py index 192a3f93a..996d93684 100644 --- a/nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py +++ b/nautobot_ssot/integrations/ipfabric/diffsync/adapter_ipfabric.py @@ -115,7 +115,7 @@ def load(self): # pylint: disable=too-many-locals,too-many-statements interfaces = self.client.inventory.interfaces.all() vlans = self.client.fetch_all("tables/vlan/site-summary") networks = defaultdict(list) - for network in self.client.technology.managed_networks.networks.fetch( + for network in self.client.technology.managed_networks.networks.all( filters={"net": ["empty", False], "siteName": ["empty", False]}, columns=["net", "siteName"], ): @@ -151,7 +151,7 @@ def load(self): # pylint: disable=too-many-locals,too-many-statements location_devices = [device for device in devices if device["siteName"] == location.name] for device in location_devices: device_name = device["hostname"] - stack_members = self.client.technology.platforms.stacks_members.fetch( + stack_members = self.client.technology.platforms.stacks_members.all( filters={"master": ["eq", device_name], "siteName": ["eq", location.name]}, columns=["master", "member", "memberSn", "pn"], ) diff --git a/nautobot_ssot/tests/ipfabric/test_ipfabric_adapter.py b/nautobot_ssot/tests/ipfabric/test_ipfabric_adapter.py index 7992e2121..28bf30d0d 100644 --- a/nautobot_ssot/tests/ipfabric/test_ipfabric_adapter.py +++ b/nautobot_ssot/tests/ipfabric/test_ipfabric_adapter.py @@ -36,8 +36,8 @@ def setUp(self): side_effect=(lambda x: VLAN_FIXTURE if x == "tables/vlan/site-summary" else "") ) ipfabric_client.inventory.interfaces.all.return_value = INTERFACE_FIXTURE - ipfabric_client.technology.managed_networks.networks.fetch.return_value = NETWORKS_FIXTURE - ipfabric_client.technology.platforms.stacks_members.fetch.side_effect = [[] for site in SITE_FIXTURE[:-1]] + [ + ipfabric_client.technology.managed_networks.networks.all.return_value = NETWORKS_FIXTURE + ipfabric_client.technology.platforms.stacks_members.all.side_effect = [[] for site in SITE_FIXTURE[:-1]] + [ STACKS_FIXTURE ]