Skip to content

Commit fab5474

Browse files
authored
Merge pull request #41 from cisco-en-programmability/wireeless_design_bug_fix
Wireless Design Bug Fix
2 parents c840791 + 7cba954 commit fab5474

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

plugins/modules/wireless_design_workflow_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3115,7 +3115,7 @@
31153115
- Commonly used for accounting and policy enforcement.
31163116
- Format typically includes AP MAC address and SSID name.
31173117
type: str
3118-
required: true
3118+
required: false
31193119
unlocked_attributes:
31203120
description:
31213121
- List of AAA Radius attribute names to unlock for manual configuration.
@@ -12716,7 +12716,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
1271612716
"AP_LABEL_ADDRESS_SSID", "AP_LOCATION", "AP_MACADDRESS", "AP_MACADDRESS_SSID",
1271712717
"AP_NAME", "AP_NAME_SSID", "IPADDRESS", "MACADDRESS", "VLAN_ID"
1271812718
]
12719-
if called_station_id not in allowed_values:
12719+
if called_station_id is not None and called_station_id not in allowed_values:
1272012720
self.msg = ("Invalid called_station_id '{0}' for design '{1}'. Must be one of: {2}".format(
1272112721
called_station_id, design_name, allowed_values))
1272212722
self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status()
@@ -12755,7 +12755,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
1275512755
payload = {
1275612756
"id": existing["id"],
1275712757
"designName": new_design_name, # Use new name
12758-
"featureAttributes": {"calledStationId": called_station_id},
12758+
"featureAttributes": {"calledStationId": called_station_id if called_station_id is not None else existing_called}
1275912759
}
1276012760
if desired_unlocked:
1276112761
payload["unlockedAttributes"] = ["calledStationId"]
@@ -12769,7 +12769,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
1276912769
payload = {
1277012770
"id": existing["id"],
1277112771
"designName": design_name, # Keep original name
12772-
"featureAttributes": {"calledStationId": called_station_id},
12772+
"featureAttributes": {"calledStationId": called_station_id if called_station_id is not None else existing_called},
1277312773
}
1277412774
if desired_unlocked:
1277512775
payload["unlockedAttributes"] = ["calledStationId"]

tests/unit/modules/catalyst/test_wireless_design_module_workflow_manager.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ def load_fixtures(self, response=None, device=""):
623623
if "aaa_radius_attribute_none_called_station_id" in self._testMethodName:
624624
self.run_catalystcenter_exec.side_effect = [
625625
self.test_data.get("Get_AAA_RADIUS_ATTRIBUTES_CONFIGURATION"),
626+
self.test_data.get("Create_AAA_Radius_Attribute"),
627+
self.test_data.get("task_019a0599-07b7-7f20-a2e2-cffc4eccb372"),
626628
]
627629

628630
if "create_ssid_invalid_ssid_type" in self._testMethodName:
@@ -1962,7 +1964,7 @@ def test_wireless_design_workflow_manager_playbook_80211be_delete(self):
19621964
)
19631965

19641966
def test_wireless_design_workflow_manager_aaa_radius_attribute_none_called_station_id(self):
1965-
"""Test that called_station_id=None does not crash with AttributeError."""
1967+
"""Test that creating aaa_radius_attribute without called_station_id succeeds."""
19661968
set_module_args(
19671969
dict(
19681970
catalystcenter_version='3.1.3.0',
@@ -1974,8 +1976,11 @@ def test_wireless_design_workflow_manager_aaa_radius_attribute_none_called_stati
19741976
config=self.test_data.get("playbook_aaa_radius_attribute_none_called_station_id")
19751977
)
19761978
)
1977-
result = self.execute_module(changed=False, failed=True)
1978-
self.assertIn("called_station_id", result.get('msg', '').lower())
1979+
result = self.execute_module(changed=True, failed=False)
1980+
self.assertIn(
1981+
"aaa_radius_attributes_add",
1982+
str(result.get('msg', ''))
1983+
)
19791984

19801985
def test_wireless_design_workflow_manager_create_ssid_invalid_ssid_type(self):
19811986
"""Test that ssid_type='GUEST' (wrong case) fails validation."""

0 commit comments

Comments
 (0)