Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accesspoint feature enhancement #449

Closed
Closed
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: 8 additions & 0 deletions plugins/module_utils/dnac.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,14 @@ 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.log(self.msg, "ERROR")
self.status = "failed"
self.module.fail_json(msg=self.msg)

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