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 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

This comment has been minimized.

@ansibot

This comment has been minimized.

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 and removed core_review labels Oct 25, 2019
@mikewiebe

This comment has been minimized.

Copy link
Contributor

mikewiebe commented Oct 28, 2019

shipit

@ansibot ansibot added shipit and removed needs_revision labels Oct 28, 2019
@NilashishC

This comment has been minimized.

Copy link
Contributor

NilashishC commented Nov 10, 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
@NilashishC

This comment has been minimized.

Copy link
Contributor

NilashishC commented Dec 9, 2019

recheck

@NilashishC NilashishC requested a review from trishnaguha Dec 12, 2019
Copy link
Contributor

NilashishC left a comment

Looks good to me. Thanks for the fix!

@ansibot ansibot added core_review and removed needs_revision labels Dec 12, 2019
@ansible-zuul

This comment has been minimized.

Copy link

ansible-zuul bot commented Dec 12, 2019

Build succeeded (third-party-check pipeline).

@ansibot ansibot added needs_revision and removed core_review labels Dec 12, 2019
@NilashishC NilashishC merged commit d72025b into ansible:devel Dec 13, 2019
2 checks passed
2 checks passed
Shippable Run 153471 status is SUCCESS.
Details
ansible/third-party-check third-party-check status: success
Details
xuxiaowei0512 added a commit to xuxiaowei0512/ansible that referenced this pull request Dec 22, 2019
* nxos_interfaces: RMB state fixes

* shippable fixes

* Add add'l comments per review

* fix long line

* Fix mode/enabled system defaults handling

* fix N3L test skips

* lint

* test updates for titanium images

* doc fix
@chrisvanheuveln

This comment has been minimized.

Copy link
Contributor Author

chrisvanheuveln commented Jan 8, 2020

@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.
Projects
None yet
5 participants
You can’t perform that action at this time.