Skip to content

Commit

Permalink
assign device to site function common changes done (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
madhansansel authored Oct 30, 2024
2 parents 18bb6fd + 6ff6963 commit d363608
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/module_utils/dnac.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,12 @@ def assign_device_to_site(self, device_ids, site_name, site_id):
Assigns the specified devices to the site. If the assignment is successful, returns True.
Otherwise, logs an error and returns False along with error details.
"""
site_response = self.get_site(site_name)
if site_response.get("response") and site_response["response"][0].get("type"):
site_type = site_response["response"][0].get("type")
if site_type not in ("building", "floor"):
self.msg = "Device(s) can only be assigned to building/floor"
self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status()

if self.get_ccc_version_as_integer() <= self.get_ccc_version_as_int_from_str("2.3.5.3"):
try:
Expand Down

0 comments on commit d363608

Please sign in to comment.