-
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 'defaults' option in the nxos_config module #51076
Fix 'defaults' option in the nxos_config module #51076
Conversation
Nxos get_config is allways called with the 'all' option. * Fix flag's calculation * Add tests
@OlivierB, just so you are aware we have a dedicated Working Group for network. |
@@ -290,9 +290,12 @@ def get_running_config(module, config=None): | |||
contents = module.params['running_config'] | |||
if not contents: | |||
if not module.params['defaults'] and config: | |||
# Optimization: The running-config has already been recovered by the backup |
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.
To make it work, not module.params['defaults']
needs to be removed from this condition.
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.
@OlivierB Also instead of only fixing it in get_running_config
, I would something like trishnaguha@4f34349
@trishnaguha OK ! |
…ults' option If 'defaults' option is true, the running-config backup is done with the all keyword.
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 the PR!
* Fix 'defaults' option in the nxos_config module Nxos get_config is allways called with the 'all' option. * Fix flag's calculation * Add tests * nxos_config: the 'backup' option take into account the value of 'defaults' option If 'defaults' option is true, the running-config backup is done with the all keyword. (cherry picked from commit 87a01df)
(cherry picked from commit 87a01df) * Fix 'defaults' option in the nxos_config module Nxos get_config is allways called with the 'all' option. * Fix flag's calculation * Add tests * nxos_config: the 'backup' option take into account the value of 'defaults' option If 'defaults' option is true, the running-config backup is done with the all keyword.
* Fix 'defaults' option in the nxos_config module Nxos get_config is allways called with the 'all' option. * Fix flag's calculation * Add tests * nxos_config: the 'backup' option take into account the value of 'defaults' option If 'defaults' option is true, the running-config backup is done with the all keyword. (cherry picked from commit 87a01df)
SUMMARY
Nxos get_config is allways called with the 'all' option.
ISSUE TYPE
COMPONENT NAME
nxos_config
ADDITIONAL INFORMATION
I have not changed the backup behavior as in the eos_config module.