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

Fix 'defaults' option in the nxos_config module #51076

Merged
merged 2 commits into from
Jan 23, 2019

Conversation

OlivierB
Copy link
Contributor

@OlivierB OlivierB commented Jan 18, 2019

SUMMARY

Nxos get_config is allways called with the 'all' option.

  • Fix flag's calculation
  • Add tests
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_config

ADDITIONAL INFORMATION

I have not changed the backup behavior as in the eos_config module.

Nxos get_config is allways called with the 'all' option.
* Fix flag's calculation
* Add tests
@ansibot
Copy link
Contributor

ansibot commented Jan 18, 2019

@OlivierB, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category nxos Cisco NXOS community small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. support:network This issue/PR relates to code supported by the Ansible Network Team. test This PR relates to tests. labels Jan 18, 2019
@trishnaguha trishnaguha self-assigned this Jan 21, 2019
@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jan 21, 2019
@@ -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
Copy link
Member

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.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Jan 22, 2019
Copy link
Member

@trishnaguha trishnaguha left a 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

@OlivierB
Copy link
Contributor Author

@trishnaguha OK !
I will implement it like in the eos_config module.

…ults' option

If 'defaults' option is true, the running-config backup is done with the all
keyword.
Copy link
Member

@trishnaguha trishnaguha left a 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!

@trishnaguha trishnaguha merged commit 87a01df into ansible:devel Jan 23, 2019
@OlivierB OlivierB deleted the alpha_nxos_config_defaults_all branch January 25, 2019 14:07
@dagwieers dagwieers added the cisco Cisco technologies label Feb 22, 2019
trishnaguha pushed a commit to trishnaguha/ansible that referenced this pull request Apr 1, 2019
* 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)
OlivierB added a commit to Alphalink/ansible that referenced this pull request Apr 1, 2019
(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.
abadger pushed a commit that referenced this pull request Apr 4, 2019
* 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)
@ansible ansible locked and limited conversation to collaborators Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cisco Cisco technologies module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. networking Network category nxos Cisco NXOS community support:core This issue/PR relates to code supported by the Ansible Engineering Team. support:network This issue/PR relates to code supported by the Ansible Network Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants