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

update ce_interface to fix bugs #57907

Merged
merged 3 commits into from
Jun 28, 2019
Merged

update ce_interface to fix bugs #57907

merged 3 commits into from
Jun 28, 2019

Conversation

yuandongx
Copy link
Contributor

@yuandongx yuandongx commented Jun 16, 2019

SUMMARY

update ce_interface to fix bugs

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/network/cloudengine/ce_interface.py

ADDITIONAL INFORMATION
  1. It is not a good way to find data from a xml tree by regular. lin379 line405.
  2. line 750,764
    Some attributes of interfaces are missing, 'ifAdminStatus', 'ifDescr', 'isL2SwitchPort'.
    So add them when get interface status.

#####Test playbook
"""

  • name: test ce_config
    gather_facts: no
    hosts: switch4

    tasks:

    • name: "Test the correct interface"
      ce_interface:
      interface: 100GE1/0/48
      admin_state: up
      description: Configured by ansible.
      ignore_errors: false"""

#####Test: befor fix
"""
The full traceback is:
Traceback (most recent call last):
File "/root/.ansible/tmp/ansible-tmp-1561707413.770977-165250362343882/AnsiballZ_ce_interface.py", line 125, in
_ansiballz_main()
File "/root/.ansible/tmp/ansible-tmp-1561707413.770977-165250362343882/AnsiballZ_ce_interface.py", line 117, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-tmp-1561707413.770977-165250362343882/AnsiballZ_ce_interface.py", line 51, in invoke_module
spec.loader.exec_module(module)
File "", line 662, in exec_module
File "", line 222, in _call_with_frames_removed
File "/tmp/ansible_ce_interface_payload_msuun_nn/main.py", line 871, in
File "/tmp/ansible_ce_interface_payload_msuun_nn/main.py", line 867, in main
File "/tmp/ansible_ce_interface_payload_msuun_nn/main.py", line 787, in work
File "/tmp/ansible_ce_interface_payload_msuun_nn/main.py", line 455, in create_interface
File "/tmp/ansible_ce_interface_payload_msuun_nn/ansible_ce_interface_payload.zip/ansible/module_utils/network/cloudengine/ce.py", line 339, in set_nc_config
File "/tmp/ansible_ce_interface_payload_msuun_nn/ansible_ce_interface_payload.zip/ansible/module_utils/network/common/netconf.py", line 76, in rpc
File "/tmp/ansible_ce_interface_payload_msuun_nn/ansible_ce_interface_payload.zip/ansible/module_utils/network/common/netconf.py", line 105, in parse_rpc_error
ansible.module_utils.connection.ConnectionError:
application
data-exists
error
8432
The interface 100GE1/0/48 already exists.





100GE1/0/48
Configured by ansible.




100GE1/0/48


"""

Test after fix

"""
changed: [10.10.30.18] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": true,
"end_state": {
"admin_state": "up",
"description": "Configured by ansible.",
"interface": "100GE1/0/48",
"mode": "layer2"
},
"existing": {
"admin_state": "up",
"description": null,
"interface": "100GE1/0/48",
"mode": "layer2"
},
"invocation": {
"module_args": {
"admin_state": "up",
"description": "Configured by ansible.",
"host": "10.10.30.18",
"interface": "100GE1/0/48",
"interface_type": null,
"l2sub": false,
"mode": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 10066,
"provider": {
"host": "10.10.30.18",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 10066,
"ssh_keyfile": null,
"timeout": null,
"transport": "cli",
"use_ssl": null,
"username": "huawei",
"validate_certs": null
},
"ssh_keyfile": null,
"state": "present",
"timeout": null,
"transport": "cli",
"use_ssl": null,
"username": "huawei",
"validate_certs": null
}
},
"proposed": {
"admin_state": "up",
"description": "Configured by ansible.",
"interface": "100GE1/0/48",
"l2sub": false,
"state": "present"
},
"updates": [
"interface 100GE1/0/48",
"description Configured by ansible."
]
}
"""

@ansibot
Copy link
Contributor

ansibot commented Jun 16, 2019

@xuxiaowei0512, 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.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) needs_triage Needs a first human triage before being processed. networking Network category support:community This issue/PR relates to code supported by the Ansible community. labels Jun 16, 2019
@yuandongx yuandongx closed this Jun 22, 2019
@yuandongx yuandongx reopened this Jun 22, 2019
@yuandongx yuandongx closed this Jun 22, 2019
@yuandongx yuandongx reopened this Jun 22, 2019
@ansibot
Copy link
Contributor

ansibot commented Jun 22, 2019

@ansibot ansibot added owner_pr This PR is made by the module's maintainer. and removed needs_maintainer Ansibot is unable to identify maintainers for this PR. (Check `author` in docs or BOTMETA.yml) labels Jun 22, 2019
@resmo
Copy link
Contributor

resmo commented Jun 27, 2019

I reviewed but I can not determine if this is correct. are there some tests reflecting this fix?

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Jun 27, 2019
@yuandongx
Copy link
Contributor Author

I reviewed but I can not determine if this is correct. are there some tests reflecting this fix?
I have commented a test result. There is a bug befor fix,and after modify the bug is fixed .
@resmo @zhongjun2 Could you please give me a shipit?

@ansibot ansibot added the traceback This issue/PR includes a traceback. label Jun 28, 2019
@yuandongxx
Copy link
Contributor

bot_status

@yuandongxx
Copy link
Contributor

shipit

@yuandongx
Copy link
Contributor Author

bot_status

@ansibot
Copy link
Contributor

ansibot commented Jun 28, 2019

Components

changelogs/fragments/57907-update-ce_interface-to-fix-bugs.yml
support: community
maintainers:

lib/ansible/modules/network/cloudengine/ce_interface.py
support: community
maintainers: QijunPan TommyLike edisonxiang freesky-edward hwDCN niuzhenguo xuxiaowei0512 zengchen1024 zhongjun2

Metadata

waiting_on: maintainer
changes_requested_by: null
needs_info: False
needs_revision: False
needs_rebase: False
merge_commits: []
too many files or commits: False
mergeable_state: clean
shippable_status: success
maintainer_shipits (module maintainers): 2
community_shipits (namespace maintainers): 0
ansible_shipits (core team members): 0
shipit_actors (maintainers or core team members): hwDCN xuxiaowei0512
shipit_actors_other: []
automerge: automerge tests passed

click here for bot help

@ansibot ansibot added automerge This PR was automatically merged by ansibot. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 28, 2019
@ansibot ansibot added the shipit This PR is ready to be merged by Core label Jun 28, 2019
@ansibot ansibot merged commit e023530 into ansible:devel Jun 28, 2019
agowa pushed a commit to agowa/ansible-1 that referenced this pull request Jun 30, 2019
* update ce_interface

* update ce_interface

* add a changelog fragment.
abadger pushed a commit that referenced this pull request Jul 9, 2019
* update ce_interface

* update ce_interface

* add a changelog fragment.

(cherry picked from commit e023530)
@ansible ansible locked and limited conversation to collaborators Aug 5, 2019
@yuandongx yuandongx deleted the dev/update/ce_interface branch September 26, 2019 06:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 automerge This PR was automatically merged by ansibot. bug This issue/PR relates to a bug. module This issue/PR relates to a module. networking Network category owner_pr This PR is made by the module's maintainer. shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants