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 nxos_ospf_vrf module auto-cost idempotency and module check mode #47190

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

dmurarasu
Copy link
Contributor

SUMMARY

Fixing auto-cost not being idempotent and module check mode for nxos_ospf_vrf module.

Fixes #43081

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_ospf_vrf

ANSIBLE VERSION
ansible 2.8.0.dev0 (devel 5cd1ba3477) last updated 2018/10/06 21:45:11 (GMT +000)
  config file = None
  configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/vagrant/ansible/lib/ansible
  executable location = bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

This PR fixes #43081
Tested on 93180YC-EX running NXOS: version 7.0(3)I6(1)


@ansibot
Copy link
Contributor

ansibot commented Oct 17, 2018

Hi @dmurarasu, thank you for submitting this pull-request!

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Oct 17, 2018

@ansibot
Copy link
Contributor

ansibot commented Oct 17, 2018

@dmurarasu, 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 support:network This issue/PR relates to code supported by the Ansible Network Team. labels Oct 17, 2018
@jborean93 jborean93 removed the needs_triage Needs a first human triage before being processed. label Oct 18, 2018
@@ -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:
Copy link
Member

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

Copy link
Contributor Author

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.

@trishnaguha trishnaguha self-assigned this Oct 23, 2018
@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 Oct 23, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 23, 2018
@trishnaguha trishnaguha merged commit dcb35c4 into ansible:devel Oct 23, 2018
trishnaguha pushed a commit to trishnaguha/ansible that referenced this pull request Oct 23, 2018
…nsible#47190)

* fixing idempotency and check mode

* modified to avoid repetitive code

(cherry picked from commit dcb35c4)
abadger pushed a commit that referenced this pull request Oct 23, 2018
…47190)

* fixing idempotency and check mode

* modified to avoid repetitive code

(cherry picked from commit dcb35c4)
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
…nsible#47190)

* fixing idempotency and check mode

* modified to avoid repetitive code
@dagwieers dagwieers added the cisco Cisco technologies label Feb 23, 2019
@ansible ansible locked and limited conversation to collaborators Jul 22, 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 core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. networking Network category nxos Cisco NXOS community support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nxos_ospf_vrf - auto-cost not idempotent and check mode not supported
5 participants