Skip to content

Commit

Permalink
Update cisco_client_sdwan.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarski0 authored Jan 9, 2025
1 parent 4e01b46 commit 399a6ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nac_collector/cisco_client_sdwan.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def extract_feature_parcel(
):
parcel_type = parcel["parcelType"]
if parcel_type.startswith(upstream_parcel_type):
parcel_type = parcel_type[len(upstream_parcel_type) :].lstrip("/")
parcel_type = parcel_type[len(upstream_parcel_type):].lstrip("/")
parcel_id = parcel["parcelId"]
new_endpoint = upstream_endpoint + "/" + parcel_type + "/" + parcel_id
response = self.get_request(self.base_url + new_endpoint)
Expand All @@ -415,9 +415,12 @@ def extract_feature_parcel(
children_endpoint_type = (
parcel_type + "/" + self.strip_backslash(children_endpoint["endpoint"])
)
children_endpoint_type = self.strip_backslash(children_endpoint_type)
children_endpoint_type1 = self.strip_backslash(children_endpoint_type)
children_endpoint_type2 = self.strip_backslash(children_endpoint_type)
if children_endpoint_type.startswith(parcel_type):
children_endpoint_type2 = children_endpoint_type1[len(parcel_type):].lstrip("/")
for subparcel in parcel.get("subparcels", []):
if subparcel["parcelType"] == children_endpoint_type:
if subparcel["parcelType"] in [children_endpoint_type1, children_endpoint_type2]:
children_entries.append(
self.extract_feature_parcel(
new_endpoint,
Expand Down

0 comments on commit 399a6ec

Please sign in to comment.