-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Conversation
@xuxiaowei0512, just so you are aware we have a dedicated Working Group for network. |
I reviewed but I can not determine if this is correct. are there some tests reflecting this fix? |
|
bot_status |
shipit |
bot_status |
Componentschangelogs/fragments/57907-update-ce_interface-to-fix-bugs.yml lib/ansible/modules/network/cloudengine/ce_interface.py Metadatawaiting_on: maintainer |
* update ce_interface * update ce_interface * add a changelog fragment.
* update ce_interface * update ce_interface * add a changelog fragment. (cherry picked from commit e023530)
SUMMARY
update ce_interface to fix bugs
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/network/cloudengine/ce_interface.py
ADDITIONAL INFORMATION
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:
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."
]
}
"""