-
Notifications
You must be signed in to change notification settings - Fork 20
Add a new network resource module nd_local_user for local users on Nexus Dashboard v4.1.0 or higher (DCNE-543) #172
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
base: master
Are you sure you want to change the base?
Conversation
a4b3de7
to
6a9aefd
Compare
plugins/modules/nd_local_user.py
Outdated
identifier_key = "loginID" | ||
|
||
nd = NDNetworkResourceModule(module, path, identifier_key) |
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.
what if an object is identified by multiple keys?
sent = deepcopy(new_config) | ||
|
||
for key in unwanted: | ||
if isinstance(key, str): |
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.
what is the reason for allowing unwanted list and str input?
# TODO: Add description to functions and clean the code | ||
# TODO: Add exception cases | ||
# NOTE: ONLY works for new API endpoints introduced in ND v4.1.0 and later | ||
class NDNetworkResourceModule(NDModule): |
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.
I like the approach of the class with generic methods that handle actions like merge etc
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.
+1
from ansible_collections.cisco.nd.plugins.module_utils.nd import NDModule, issubset, sanitize | ||
|
||
|
||
# TODO: Maybe make it an all new module class with request, exit_json, fail_json, etc... |
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.
agree with this part, where we can also have a look at clean up current code
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.
+1
self.previous = [] | ||
self.proposed = [] | ||
self.sent = [] | ||
self.init_all_existing = self.query_obj(path=path, ignore_not_found_error=True) |
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.
will this work for all endpoints? I noticed from NDO point of view for instance that the detailed view sometimes is deviating from the list view. Example would we templates and template summaries.
e38fee8
to
df74fbf
Compare
… Nexus Dashboard v4.1.0 and higher.
df74fbf
to
fe89c61
Compare
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.
Add comments to exaplain how the class works (or what is happening within the class)
No description provided.