Skip to content

Commit

Permalink
Validated the invalid device roles and corrected the documentation is…
Browse files Browse the repository at this point in the history
  • Loading branch information
madhansansel authored Dec 9, 2024
2 parents 943a7ba + 05c61b0 commit 034bead
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion plugins/modules/sda_fabric_devices_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
- This parameter is required when adding the device to the fabric site.
- The device roles cannot be updated once assigned.
- At least one device must be a CONTROL_PLANE_NODE to assign roles to other devices.
- An EDGE_NODE in a fabric cannot be a CONTROL_PLANE_NODE.
- The device role [CONTROL_PLANE_NODE, EDGE_NODE] is not allowed.
- Available roles,
- CONTROL_PLANE_NODE - Manages the mapping of endpoint IP addresses to their location
within the network using LISP, enabling mobility.
Expand Down Expand Up @@ -2153,7 +2155,7 @@ def get_have_fabric_devices(self, fabric_devices):
fabric_site_id = self.get_fabric_zone_id_from_name(fabric_name, site_id)
if not fabric_site_id:
self.msg = (
"The provided 'fabric_name' '{fabric_name}' is not valid a fabric site."
"The provided 'fabric_name' '{fabric_name}' is not a valid fabric site."
.format(fabric_name=fabric_name)
)
if self.params.get("state") == "deleted":
Expand Down Expand Up @@ -2458,6 +2460,16 @@ def get_device_params(self, fabric_id, network_id, device_details, config_index)
# Device IP and the Fabric name is mandatory and cannot be fetched from the Cisco Catalyst Center
device_roles = device_details.get("device_roles")
self.log("Device roles provided: {roles}".format(roles=device_roles), "DEBUG")
if sorted(device_roles) == ["CONTROL_PLANE_NODE", "EDGE_NODE"]:
self.msg = (
"The current combination of roles {device_roles} is invalid. "
"An EDGE_NODE in a fabric cannot be a CONTROL_PLANE_NODE."
.format(device_roles=device_roles)
)
self.log(self.msg, "ERROR")
self.status = "failed"
self.check_return_status()

if not have_device_exists:
if not device_roles:
self.msg = (
Expand Down

0 comments on commit 034bead

Please sign in to comment.