Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/modules/wireless_design_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3115,7 +3115,7 @@
- Commonly used for accounting and policy enforcement.
- Format typically includes AP MAC address and SSID name.
type: str
required: true
required: false
unlocked_attributes:
description:
- List of AAA Radius attribute names to unlock for manual configuration.
Expand Down Expand Up @@ -12716,7 +12716,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
"AP_LABEL_ADDRESS_SSID", "AP_LOCATION", "AP_MACADDRESS", "AP_MACADDRESS_SSID",
"AP_NAME", "AP_NAME_SSID", "IPADDRESS", "MACADDRESS", "VLAN_ID"
]
if called_station_id not in allowed_values:
if called_station_id is not None and called_station_id not in allowed_values:
self.msg = ("Invalid called_station_id '{0}' for design '{1}'. Must be one of: {2}".format(
called_station_id, design_name, allowed_values))
self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status()
Expand Down Expand Up @@ -12755,7 +12755,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
payload = {
"id": existing["id"],
"designName": new_design_name, # Use new name
"featureAttributes": {"calledStationId": called_station_id},
"featureAttributes": {"calledStationId": called_station_id if called_station_id is not None else existing_called}
}
if desired_unlocked:
payload["unlockedAttributes"] = ["calledStationId"]
Expand All @@ -12769,7 +12769,7 @@ def verify_create_update_aaa_radius_attributes_requirement(self, aaa_attr_list):
payload = {
"id": existing["id"],
"designName": design_name, # Keep original name
"featureAttributes": {"calledStationId": called_station_id},
"featureAttributes": {"calledStationId": called_station_id if called_station_id is not None else existing_called},
}
if desired_unlocked:
payload["unlockedAttributes"] = ["calledStationId"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ def load_fixtures(self, response=None, device=""):
if "aaa_radius_attribute_none_called_station_id" in self._testMethodName:
self.run_catalystcenter_exec.side_effect = [
self.test_data.get("Get_AAA_RADIUS_ATTRIBUTES_CONFIGURATION"),
self.test_data.get("Create_AAA_Radius_Attribute"),
self.test_data.get("task_019a0599-07b7-7f20-a2e2-cffc4eccb372"),
]

if "create_ssid_invalid_ssid_type" in self._testMethodName:
Expand Down Expand Up @@ -1962,7 +1964,7 @@ def test_wireless_design_workflow_manager_playbook_80211be_delete(self):
)

def test_wireless_design_workflow_manager_aaa_radius_attribute_none_called_station_id(self):
"""Test that called_station_id=None does not crash with AttributeError."""
"""Test that creating aaa_radius_attribute without called_station_id succeeds."""
set_module_args(
dict(
catalystcenter_version='3.1.3.0',
Expand All @@ -1974,8 +1976,11 @@ def test_wireless_design_workflow_manager_aaa_radius_attribute_none_called_stati
config=self.test_data.get("playbook_aaa_radius_attribute_none_called_station_id")
)
)
result = self.execute_module(changed=False, failed=True)
self.assertIn("called_station_id", result.get('msg', '').lower())
result = self.execute_module(changed=True, failed=False)
self.assertIn(
"aaa_radius_attributes_add",
str(result.get('msg', ''))
)

def test_wireless_design_workflow_manager_create_ssid_invalid_ssid_type(self):
"""Test that ssid_type='GUEST' (wrong case) fails validation."""
Expand Down
Loading