From a6ab69330a0b4e387d413083ac54f186d72097c2 Mon Sep 17 00:00:00 2001 From: Sabari Jaganathan <93724860+sajagana@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:06:10 +0530 Subject: [PATCH] [ignore] Updated the device_payload data logic in mso_schema_site_service_graph.py module --- plugins/module_utils/mso.py | 6 +++--- plugins/modules/mso_schema_site_service_graph.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/mso.py b/plugins/module_utils/mso.py index 018f4fb7..b8eba9ab 100644 --- a/plugins/module_utils/mso.py +++ b/plugins/module_utils/mso.py @@ -859,11 +859,11 @@ def lookup_roles(self, roles, ignore_not_found_error=False): ids.append(dict(roleId=r.get("id"), accessType=access_type)) return ids - def lookup_site_type(self, s): + def lookup_site_type(self, site_data): """Get site type(AWS, AZURE or physical)""" - site_type = s.get("platform") + site_type = site_data.get("platform") if site_type == "cloud": - self.cloud_provider_type = s.get("cloudProviders")[0] + self.cloud_provider_type = site_data.get("cloudProviders")[0] self.site_type = site_type def lookup_site(self, site, ignore_not_found_error=False): diff --git a/plugins/modules/mso_schema_site_service_graph.py b/plugins/modules/mso_schema_site_service_graph.py index 04b0261e..15c3fa6b 100644 --- a/plugins/modules/mso_schema_site_service_graph.py +++ b/plugins/modules/mso_schema_site_service_graph.py @@ -282,8 +282,8 @@ def main(): if devices is not None: query_device_data = mso.lookup_service_node_device(site_id, tenant, device_name=None, service_node_type=None) for index, device in enumerate(devices): - device_payload = dict() if query_device_data: + device_payload = dict() for device_data in query_device_data: if device.get("device_name") == device_data.get("dn").split("/")[-1].split("-")[-1]: device_payload["device"] = dict( @@ -350,7 +350,7 @@ def main(): device_payload["providerConnectorType"] = AZURE_L4L7_CONNECTOR_TYPE_MAP.get(provider_connector_type) device_payload["consumerConnectorType"] = AZURE_L4L7_CONNECTOR_TYPE_MAP.get(consumer_connector_type) - devices_payload.append(device_payload) + devices_payload.append(device_payload) payload = dict( serviceGraphRef=dict(