Skip to content

Commit

Permalink
[ignore] Updated the device_payload data logic in mso_schema_site_ser…
Browse files Browse the repository at this point in the history
…vice_graph.py module
  • Loading branch information
sajagana authored and lhercot committed Feb 28, 2024
1 parent 03e56fd commit a6ab693
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions plugins/module_utils/mso.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/mso_schema_site_service_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a6ab693

Please sign in to comment.