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

nxos_interfaces: RMB state fixes #63960

Merged
merged 9 commits into from Dec 13, 2019

Conversation

chrisvanheuveln
Copy link
Contributor

@chrisvanheuveln chrisvanheuveln commented Oct 25, 2019

SUMMARY

nxos_interfaces hit a number of failures in our regression testbeds. When I dug into it I found a number of issues including but not limited to:

  • cross-platform issues

  • different default states depending on interface types

  • idempotence issues

  • unnecessarily changing state on attributes that will cause churn in a network; e.g. changing description with state: replaced would result in toggling enabled off and on, even when enabled was already at the desired state.

  • did not handle non-existent virtual interfaces correctly

  • enable default state is dependent on device type, interface type, and the state of the system default switchport configurations. I've left comments in the code as well but I'll include them here for PR clarity. The gist is that "factory default" for enable really only applies to L3 interfaces and that system default switchport config commands define the defaults for L2 interfaces:

    L3 interfaces:
     - Most L3 intfs default to `shutdown`. Loopbacks default to `no shutdown`.
     - Some legacy platforms default L3 intfs to 'no shutdown' (e.g. N3K, N6K)
    L2:
     - An intf may be explicitly defined as L2 with 'switchport', or it may be implicitly defined
       as L2 when "User System Default" command 'system default switchport' is defined.
     - The USD configuration `system default switchport shutdown' defines the enabled state
       for L2 intf's.
     - USD defaults may be different on some platforms. Default `system default` commands may
       not display with `show run` so you need to use `show run all` to see them.

I added a fairly involved Unit Test that covers a wide variety of common scenarios and tests each of the merged/deleted/replaced/overridden states. I believe that if you review those scenarios first it will help to understand the logic I added to this module.

The changeset in this PR now passes all of the Unit Tests, and all of the regression tests are now passing on our regression testbeds: N3K/N6K/N7K/N9K/NXOSv (internal IDs: n3k-173,n6k-77,n7k-99,dt-n9k5-1,n7k-j,evergreen-nx-1,greensboro-nx-1,hamilton-nx-1,camden-nx-1)

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_interfaces

ADDITIONAL INFORMATION

@ansibot
Copy link
Contributor

ansibot commented Oct 25, 2019

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 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. needs_triage Needs a first human triage before being processed. 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. labels Oct 25, 2019
@ansibot
Copy link
Contributor

ansibot commented Oct 25, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/network/nxos/nxos_interfaces.py:0:0: doc-default-does-not-match-spec: Argument 'enabled' in argument_spec found in config defines default as (False) but documentation defines default as (True)

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/module_utils/network/nxos/config/interfaces/interfaces.py:293:4: dangerous-default-value: Dangerous default value {} as argument

click here for bot help

@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 25, 2019
@ansibot ansibot added module This issue/PR relates to a module. 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 25, 2019
@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. needs_triage Needs a first human triage before being processed. labels Oct 28, 2019
@mikewiebe
Copy link
Contributor

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Oct 28, 2019
@NilashishC
Copy link
Contributor

cc @trishnaguha

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed shipit This PR is ready to be merged by Core labels Nov 19, 2019
@chrisvanheuveln chrisvanheuveln changed the title nxos_interfaces: RMB state fixes (WIP) nxos_interfaces: RMB state fixes Nov 20, 2019
@chrisvanheuveln chrisvanheuveln changed the title (WIP) nxos_interfaces: RMB state fixes nxos_interfaces: RMB state fixes Dec 2, 2019
@ansibot ansibot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 5, 2019
@NilashishC
Copy link
Contributor

recheck

Copy link
Contributor

@NilashishC NilashishC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for the fix!

@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 Dec 12, 2019
@ansible-zuul
Copy link

ansible-zuul bot commented Dec 12, 2019

Build succeeded (third-party-check pipeline).

@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 Dec 12, 2019
@chrisvanheuveln
Copy link
Contributor Author

@NilashishC Please cherry-pick to 2.9.x -Thanks

@ansible ansible locked and limited conversation to collaborators Jan 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 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

5 participants