-
Notifications
You must be signed in to change notification settings - Fork 9
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
Site enhancement module #451
base: main
Are you sure you want to change the base?
Site enhancement module #451
Conversation
@@ -410,7 +410,7 @@ | |||
""" | |||
|
|||
floor_plan = { | |||
'101101': 'Cubes And Walled Offices', | |||
'107107': 'Cubes And Walled Offices', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to change this?
- If the response is empty, a warning is logged. | ||
- Any exceptions during the API call are caught, logged as errors, and the function returns None. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.log("Fetching site details for site hierarchy: '{0}'".format(site_name_hierarchy), "INFO")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this log
) | ||
|
||
if not response: | ||
self.log("The response from 'get_sites' is empty.", "WARNING") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always print with site_name.. Otherwise how do we know it?
self.log("Empty response received for site: {0}".format(site_name_hierarchy), "WARNING")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this log
self.log("The response from 'get_sites' is empty.", "WARNING") | ||
return None | ||
|
||
self.log("Received API response from 'get_sites': {0}".format(str(response)), "DEBUG") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.log("Received API response for site '{0}' from 'get_sites': {1}".format(site_name_hierarchy, response), "DEBUG")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this log
return response | ||
|
||
except Exception as e: | ||
self.log("An error occurred in 'get_sites':{0}".format(e), "ERROR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print site_name_hierarchy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
|
||
return (site_exists, current_site) | ||
try: | ||
bulk_operation = self.config[0].get('site', {}).get('bulk_operation', False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we support bulk operation for the CatC version below 2.3.5.3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, Added else condition now above try block
Description
Update the Site module to support for replacement of membership APIs, and implement bulk site creation and upload floor map, update and delete site APIs for improved functionality with version-based routing.
Type of Change
Checklist
Ansible Best Practices
ansible-vault
or environment variables)Documentation
Screenshots (if applicable)
Notes to Reviewers