-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Fix nxos_ospf_vrf module auto-cost idempotency and module check mode #47190
Fix nxos_ospf_vrf module auto-cost idempotency and module check mode #47190
Conversation
Hi @dmurarasu, thank you for submitting this pull-request! |
@dmurarasu, just so you are aware we have a dedicated Working Group for network. |
@@ -405,14 +405,15 @@ def main(): | |||
if state == 'absent' and existing: | |||
state_absent(module, existing, proposed, candidate) | |||
|
|||
if candidate: | |||
if not module.check_mode and candidate: |
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.
Thanks for your contribution.
Please update this code block to the following to avoid repetitive code:
if candidate:
candidate = candidate.items_text()
result['commands'] = candidate
if not module.check_mode:
load_config(module, candidate)
result['changed'] = 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.
that makes a lot of sense, thanks Trishna, now updated.
813b4e8
to
a6ede50
Compare
…nsible#47190) * fixing idempotency and check mode * modified to avoid repetitive code (cherry picked from commit dcb35c4)
…nsible#47190) * fixing idempotency and check mode * modified to avoid repetitive code
SUMMARY
Fixing auto-cost not being idempotent and module check mode for nxos_ospf_vrf module.
Fixes #43081
ISSUE TYPE
COMPONENT NAME
nxos_ospf_vrf
ANSIBLE VERSION
ADDITIONAL INFORMATION
This PR fixes #43081
Tested on 93180YC-EX running NXOS: version 7.0(3)I6(1)