Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #829 from cisco-open/fix/update
Browse files Browse the repository at this point in the history
Fix/update
  • Loading branch information
jpkrajewski authored Sep 18, 2024
2 parents 310aabf + 5d33ae3 commit 8d975b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions catalystwan/api/feature_profile_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,19 +909,18 @@ def get_parcel(
def update_parcel(
self,
profile_id: UUID,
parcel_type: Type[AnyServiceParcel],
parcel_id: UUID,
payload: AnyServiceParcel,
parcel_id: UUID,
vpn_uuid: Optional[UUID] = None,
) -> ParcelCreationResponse:
"""
Update Service Parcel for selected profile_id based on payload type
"""
if vpn_uuid is not None:
return self.endpoint.update_lan_vpn_sub_parcel(
profile_id, vpn_uuid, removeprefix(parcel_type._get_parcel_type(), "lan/vpn/"), parcel_id, payload
profile_id, vpn_uuid, removeprefix(payload._get_parcel_type(), "lan/vpn/"), parcel_id, payload
)
return self.endpoint.update(profile_id, parcel_type._get_parcel_type(), parcel_id, payload)
return self.endpoint.update(profile_id, payload._get_parcel_type(), parcel_id, payload)


class SystemFeatureProfileAPI:
Expand Down Expand Up @@ -1869,7 +1868,7 @@ def create_parcel(self, profile_id: UUID, config: ConfigParcel) -> ParcelCreatio
"""
return self.endpoint.create(profile_id, config)

def update_parcel(self, profile_id: UUID, parcel_id: UUID, config: ConfigParcel) -> ParcelCreationResponse:
def update_parcel(self, profile_id: UUID, config: ConfigParcel, parcel_id: UUID) -> ParcelCreationResponse:
"""
Update CLI Parcel for selected profile_id
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_update(self):

dhcp_server_parcel.address_pool.network_address = Global[IPv4Address](value=IPv4Address("10.3.2.1"))
dhcp_server_parcel.address_pool.subnet_mask = Global[SubnetMask](value="248.0.0.0")
parcel_id = self.api.update_parcel(self.profile_uuid, LanVpnDhcpServerParcel, parcel_id, dhcp_server_parcel).id
parcel_id = self.api.update_parcel(self.profile_uuid, dhcp_server_parcel, parcel_id).id
parcel = self.api.get_parcel(self.profile_uuid, LanVpnDhcpServerParcel, parcel_id)
assert isinstance(parcel.payload, LanVpnDhcpServerParcel)
assert parcel.payload == dhcp_server_parcel
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "catalystwan"
version = "0.35.4dev2"
version = "0.35.4dev3"
description = "Cisco Catalyst WAN SDK for Python"
authors = ["kagorski <kagorski@cisco.com>"]
readme = "README.md"
Expand Down

0 comments on commit 8d975b4

Please sign in to comment.