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

adding the modules to /nxos/storage/ folder #64269

Merged
merged 7 commits into from Dec 16, 2019
Merged

Conversation

@srbharadwaj
Copy link
Contributor

srbharadwaj commented Nov 1, 2019

This PR is for adding new modules for NXOS
Platform Type: MDS switches
Modules added:
a) nxos_vsan : Configuration of vsan for Cisco MDS NXOS.
b) nxos_devicealias: Configuration of device alias for Cisco MDS NXOS.
c) nxos_zone_zoneset: Configuration of zone/zoneset for Cisco MDS NXOS.
ISSUE TYPE

New Module Pull Request

COMPONENT NAME

nxos_vsan, nxos_devicealias, nxos_zone_zoneset
ADDITIONAL INFORMATION

This commit contains units tests and integration tests for these modules.
Please note that these modules run only on NXOS MDS switches.
You could find the type of switch via the following command
switch(config)# sh ver | json | i chassis
<chassis_id>MDS 9710 (10 Slot) Chassis</chassis_id>

Note: Previous PR was #59595 , i closed that as there were merge conflicts

srbharadwaj added 2 commits Nov 1, 2019
@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 1, 2019

@srbharadwaj this PR contains more than one new module.

Please submit only one new module per pull request. For a detailed explanation, please read the grouped modules documentation

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Nov 1, 2019

@srbharadwaj, 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

@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Nov 1, 2019

Got this error(Shippable/support#4872) , so closing the PR and reopening again.

@srbharadwaj srbharadwaj closed this Nov 1, 2019
@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Nov 1, 2019

Reopening...

@srbharadwaj srbharadwaj reopened this Nov 1, 2019
@ansibot

This comment was marked as outdated.

Copy link
Contributor

ansibot commented Nov 1, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 6 errors:

lib/ansible/modules/network/nxos/storage/nxos_devicealias.py:0:0: module-incorrect-version-added: version_added should be '2.10'. Currently 2.1
lib/ansible/modules/network/nxos/storage/nxos_devicealias.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
lib/ansible/modules/network/nxos/storage/nxos_vsan.py:0:0: module-incorrect-version-added: version_added should be '2.10'. Currently 2.1
lib/ansible/modules/network/nxos/storage/nxos_vsan.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
lib/ansible/modules/network/nxos/storage/nxos_zone_zoneset.py:0:0: module-incorrect-version-added: version_added should be '2.10'. Currently 2.1
lib/ansible/modules/network/nxos/storage/nxos_zone_zoneset.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec

The test ansible-test sanity --test pylint [explain] failed with 39 errors:

test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:68:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:69:84: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:78:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:79:84: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:80:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:89:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:90:87: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:91:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:100:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:101:87: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:111:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:112:78: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:113:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:123:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:124:81: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:134:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:135:87: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:144:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:145:84: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:146:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:194:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:195:78: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:196:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:231:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:232:78: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:233:86: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:234:79: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:235:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:254:66: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:255:75: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:256:89: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:257:81: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:258:71: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:299:77: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:300:73: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:301:63: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:302:69: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:322:74: trailing-whitespace: Trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:323:63: trailing-whitespace: Trailing whitespace

The test ansible-test sanity --test pep8 [explain] failed with 56 errors:

test/units/modules/network/nxos/storage/test_nxos_devicealias.py:125:9: E265: block comment should start with '# '
test/units/modules/network/nxos/storage/test_nxos_devicealias.py:136:9: E265: block comment should start with '# '
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:68:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:69:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:69:85: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:78:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:79:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:79:85: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:80:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:89:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:90:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:90:88: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:91:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:100:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:101:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:101:88: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:111:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:112:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:112:79: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:113:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:123:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:124:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:124:82: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:134:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:135:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:135:88: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:144:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:145:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:145:85: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:146:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:194:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:195:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:195:79: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:196:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:231:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:232:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:232:79: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:233:87: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:234:80: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:235:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:254:67: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:255:49: E127: continuation line over-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:255:76: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:256:90: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:257:82: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:258:72: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:299:78: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:300:74: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:301:26: E128: continuation line under-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:301:64: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:302:26: E128: continuation line under-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:302:70: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:303:26: E128: continuation line under-indented for visual indent
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:322:75: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:323:64: W291: trailing whitespace
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:324:26: E128: continuation line under-indented for visual indent

The test ansible-test sanity --test shebang [explain] failed with 3 errors:

test/units/modules/network/nxos/storage/test_nxos_devicealias.py:1:1: unexpected non-module shebang: b'#!/usr/bin/python'
test/units/modules/network/nxos/storage/test_nxos_vsan.py:1:1: unexpected non-module shebang: b'#!/usr/bin/python'
test/units/modules/network/nxos/storage/test_nxos_zone_zoneset.py:1:1: unexpected non-module shebang: b'#!/usr/bin/python'

click here for bot help

@ansibot ansibot added ci_verified and removed ci_verified labels Nov 1, 2019
@ansibot

This comment was marked as outdated.

Copy link
Contributor

ansibot commented Nov 1, 2019

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

lib/ansible/modules/network/nxos/storage/nxos_devicealias.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
lib/ansible/modules/network/nxos/storage/nxos_vsan.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec
lib/ansible/modules/network/nxos/storage/nxos_zone_zoneset.py:0:0: nonexistent-parameter-documented: Argument 'provider' is listed in DOCUMENTATION.options, but not accepted by the module argument_spec

click here for bot help

@ansibot ansibot added the ci_verified label Nov 1, 2019
@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Nov 2, 2019

@mikewiebe @trishnaguha Can anyone tell me what this is, I have not specified any “provider” argument, so why is it throwing the above error?

@mikewiebe

This comment has been minimized.

Copy link
Contributor

mikewiebe commented Nov 4, 2019

@mikewiebe @trishnaguha Can anyone tell me what this is, I have not specified any “provider” argument, so why is it throwing the above error?

Not sure why you are getting that error since as you stated there is no documentation for that. @trishnaguha do you know why this error is being generated?

@srbharadwaj You should probably remove all references to provider in your integration tests however.

@ansibot ansibot removed the needs_triage label Nov 4, 2019
@chrisvanheuveln

This comment has been minimized.

Copy link
Contributor

chrisvanheuveln commented Nov 4, 2019

@mikewiebe These new modules do extends_documentation_fragment: nxos, and there is a provider tag in ModuleDocFragment from lib/ansible/plugins/doc_fragments/nxos.py. I'm not sure how the linkage works with this but it might explain the error.

@mikewiebe

This comment has been minimized.

Copy link
Contributor

mikewiebe commented Nov 5, 2019

@mikewiebe These new modules do extends_documentation_fragment: nxos, and there is a provider tag in ModuleDocFragment from lib/ansible/plugins/doc_fragments/nxos.py. I'm not sure how the linkage works with this but it might explain the error.

Thanks for this bit of sleuthing @chrisvanheuveln. @srbharadwaj , maybe as a first step try removing the extends to see if that fixes the error?

@ansibot ansibot removed the ci_verified label Nov 6, 2019
@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Nov 6, 2019

@mikewiebe These new modules do extends_documentation_fragment: nxos, and there is a provider tag in ModuleDocFragment from lib/ansible/plugins/doc_fragments/nxos.py. I'm not sure how the linkage works with this but it might explain the error.

Thanks for this bit of sleuthing @chrisvanheuveln. @srbharadwaj , maybe as a first step try removing the extends to see if that fixes the error?

Thanks guys i have fixed this error as well the integration tests cases that Mike mentioned. Please review and get the PR closed

@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Nov 12, 2019

@chrisvanheuveln @trishnaguha can you please review this and accept the PR?

@ansibot ansibot added the stale_ci label Nov 20, 2019
@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Dec 4, 2019

@chrisvanheuveln @trishnaguha can you please review this and accept the PR? Its open for a while

required:
True
type: str
'''

This comment has been minimized.

Copy link
@ganeshrn

ganeshrn Dec 9, 2019

Member

You can add the information of the OS version the module is tested against Refer https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/network/nxos/nxos_lldp_global.py#L43

This comment has been minimized.

Copy link
@ganeshrn

ganeshrn Dec 9, 2019

Member

Applicable to all the modules in this PR

This comment has been minimized.

Copy link
@srbharadwaj

srbharadwaj Dec 9, 2019

Author Contributor

Done

@ansibot ansibot removed the stale_ci label Dec 9, 2019
@@ -0,0 +1,33 @@
---

This comment has been minimized.

Copy link
@NilashishC

NilashishC Dec 10, 2019

Contributor

nxapi.yaml seems to be commented out in tasks/main.yaml. In that case, this file is not required.

- id: "{{ vsan1 | int }}"
- id: "{{ vsan2 | int }}"
- name: "Configure zone and zoneset"
nxos_zone_zoneset:

This comment has been minimized.

Copy link
@NilashishC

NilashishC Dec 10, 2019

Contributor
Suggested change
nxos_zone_zoneset:
nxos_zone_zoneset: &zoneset
that:
- "result.changed == true"
- name: "Idempotence Check"
nxos_zone_zoneset:

This comment has been minimized.

Copy link
@NilashishC

NilashishC Dec 10, 2019

Contributor
Suggested change
nxos_zone_zoneset:
nxos_zone_zoneset: *zoneset

This comment has been minimized.

Copy link
@NilashishC

NilashishC Dec 10, 2019

Contributor

This will allow reusing the previous task in the idempotence tests. Valid for all the integration tests in this PR.

This comment has been minimized.

Copy link
@srbharadwaj

srbharadwaj Dec 10, 2019

Author Contributor

done

@ansible-zuul

This comment has been minimized.

Copy link

ansible-zuul bot commented Dec 16, 2019

Build succeeded (third-party-check pipeline).

@NilashishC

This comment has been minimized.

Copy link
Contributor

NilashishC commented Dec 16, 2019

Zuul failures are for NX-OS. MDS tests are skipped.

@NilashishC NilashishC merged commit 0a04a5e into ansible:devel Dec 16, 2019
2 checks passed
2 checks passed
Shippable Run 153729 status is SUCCESS.
Details
ansible/third-party-check third-party-check status: success
Details
@srbharadwaj

This comment has been minimized.

Copy link
Contributor Author

srbharadwaj commented Dec 16, 2019

Thank you @NilashishC

xuxiaowei0512 added a commit to xuxiaowei0512/ansible that referenced this pull request Dec 22, 2019
* adding the modules to /nxos/storage/ folder

* fix pep8 stuff

* fixed provider specific information from doc

* Fix integration tests

* Added tested against note

* Review comments

* added assertions for the commands sent in the integration tests
@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.
You can’t perform that action at this time.