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

fix bugs for ce. #55259

Closed
wants to merge 6 commits into from

Conversation

Projects
None yet
3 participants
@weixiaoxu0512
Copy link

commented Apr 14, 2019

SUMMARY
ansible 2.9.0.dev0
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
lib/ansible/module_utils/network/cloudengine/ce.py
lib/ansible/modules/network/cloudengine/ce_aaa_server.py
lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py
lib/ansible/modules/network/cloudengine/ce_command.py
lib/ansible/modules/network/cloudengine/ce_facts.py
lib/ansible/modules/network/cloudengine/ce_netconf.py
lib/ansible/modules/network/cloudengine/ce_vlan.py
lib/ansible/plugins/action/ce.py
....
ADDITIONAL INFORMATION
Before modify
task path: /usr/huawei/zhangyan/test_playbook/test_ce_command.yml:298
<10.130.200.118> connection transport is cli
<10.130.200.118> using connection plugin network_cli (was local)
<10.130.200.118> starting connection from persistent connection plugin
<10.130.200.118> found existing local domain socket, using it!
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> updating play_context for connection
<10.130.200.118>
<10.130.200.118> local domain socket path is /root/.ansible/pc/298903fe61
<10.130.200.118> socket_path: /root/.ansible/pc/298903fe61
<10.130.200.118> wrong context, sending exit to device
The full traceback is:
Traceback (most recent call last):
File "/usr/local/python3.5/lib/python3.5/site-packages/ansible-2.8.0.dev0-py3.5.egg/ansible/executor/task_executor.py", line 144, in run
res = self._execute()
File "/usr/local/python3.5/lib/python3.5/site-packages/ansible-2.8.0.dev0-py3.5.egg/ansible/executor/task_executor.py", line 645, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/local/python3.5/lib/python3.5/site-packages/ansible-2.8.0.dev0-py3.5.egg/ansible/plugins/action/ce.py", line 93, in run
conn.send_command('exit')
File "/usr/local/python3.5/lib/python3.5/site-packages/ansible-2.8.0.dev0-py3.5.egg/ansible/module_utils/connection.py", line 186, in rpc
raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
ansible.module_utils.connection.ConnectionError: exit
^
Error: Unrecognized command found at '^' position.
[~6865_130.52-25GE1/0/1]

fatal: [10.130.200.118]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}
...ignoring
META: ran handlers
META: ran handlers

After

ansible-playbook 2.9.0.dev0
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.9.0.dev0-py2.7.egg/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass it's verify_file() method
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/site-packages/ansible-2.9.0.dev0-py2.7.egg/ansible/plugins/callback/default.pyc

PLAYBOOK: test.yml ********************************************************************************************************
Positional arguments: test.yml
become_method: sudo
inventory: (u'/etc/ansible/hosts',)
forks: 5
tags: (u'all',)
verbosity: 4
connection: smart
timeout: 10
1 plays in test.yml

PLAY [test ce_command] ****************************************************************************************************
META: ran handlers

TASK [Step1.1 Test commands display device] *******************************************************************************
task path: /usr/xuyuandong/tmp/test.yml:11
<10.130.200.118> attempting to start connection
<10.130.200.118> using connection plugin network_cli
<10.130.200.118> local domain socket does not exist, starting it
<10.130.200.118> control socket path is /root/.ansible/pc/28855f346b
<10.130.200.118> <10.130.200.118> ESTABLISH PARAMIKO SSH CONNECTION FOR USER: huawei on PORT 10066 TO 10.130.200.118
<10.130.200.118> connection to remote device started successfully
<10.130.200.118> local domain socket listeners started successfully
<10.130.200.118> loaded cliconf plugin for network_os ce
<10.130.200.118> ssh connection done, setting terminal
<10.130.200.118> loaded terminal plugin for network_os ce
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> firing event: on_open_shell()
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> ssh connection has completed successfully
<10.130.200.118>
<10.130.200.118> local domain socket path is /root/.ansible/pc/28855f346b
<10.130.200.118> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.130.200.118> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816" && echo ansible-tmp-1555417821.03-279295155451816="echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816" ) && sleep 0'
<10.130.200.118> Attempting python interpreter discovery
<10.130.200.118> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<10.130.200.118> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible-2.9.0.dev0-py2.7.egg/ansible/modules/network/cloudengine/ce_command.py
<10.130.200.118> PUT /root/.ansible/tmp/ansible-local-147Fifh53/tmpPT96lu TO /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816/AnsiballZ_ce_command.py
<10.130.200.118> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816/ /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417821.03-279295155451816/ > /dev/null 2>&1 && sleep 0'
ok: [10.130.200.118] => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"invocation": {
"module_args": {
"commands": [
"display device"
],
"host": null,
"interval": 1,
"match": "all",
"password": null,
"port": null,
"provider": null,
"retries": 10,
"ssh_keyfile": null,
"timeout": null,
"transport": null,
"use_ssl": null,
"username": null,
"validate_certs": null,
"wait_for": null
}
},
"stdout": [
"Device status:\n--------------------------------------------------------------------------------\nSlot Card Type Online Power Register Alarm Primary \n--------------------------------------------------------------------------------\n1 - CE6865-48S8CQ-EI Present On Registered Normal Master \n FAN1 FAN-40HA-F Present On Registered Normal NA \n FAN2 FAN-40HA-F Present On Registered Normal NA \n PWR1 PAC-600WA-F Present Off Unregistered Abnormal NA \n PWR2 PAC-600WA-F Present On Registered Normal NA \n--------------------------------------------------------------------------------"
],
"stdout_lines": [
[
"Device status:",
"--------------------------------------------------------------------------------",
"Slot Card Type Online Power Register Alarm Primary ",
"--------------------------------------------------------------------------------",
"1 - CE6865-48S8CQ-EI Present On Registered Normal Master ",
" FAN1 FAN-40HA-F Present On Registered Normal NA ",
" FAN2 FAN-40HA-F Present On Registered Normal NA ",
" PWR1 PAC-600WA-F Present Off Unregistered Abnormal NA ",
" PWR2 PAC-600WA-F Present On Registered Normal NA ",
"--------------------------------------------------------------------------------"
]
]
}

TASK [Step6.5.2 Repeat configuration test] ********************************************************************************
task path: /usr/xuyuandong/tmp/test.yml:286
<10.130.200.118> attempting to start connection
<10.130.200.118> using connection plugin network_cli
<10.130.200.118> found existing local domain socket, using it!
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> updating play_context for connection
<10.130.200.118>
<10.130.200.118> local domain socket path is /root/.ansible/pc/28855f346b
<10.130.200.118> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.130.200.118> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045" && echo ansible-tmp-1555417823.33-80347032278045="echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible-2.9.0.dev0-py2.7.egg/ansible/modules/network/cloudengine/ce_command.py
<10.130.200.118> PUT /root/.ansible/tmp/ansible-local-147Fifh53/tmppZ3wfI TO /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045/AnsiballZ_ce_command.py
<10.130.200.118> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045/ /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417823.33-80347032278045/ > /dev/null 2>&1 && sleep 0'
ok: [10.130.200.118] => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"system-view",
"interface 25GE1/0/1",
"description qqqq",
"description qqqq",
"commit"
],
"host": null,
"interval": 1,
"match": "all",
"password": null,
"port": null,
"provider": null,
"retries": 10,
"ssh_keyfile": null,
"timeout": null,
"transport": null,
"use_ssl": null,
"username": null,
"validate_certs": null,
"wait_for": null
}
},
"stdout": [
"Enter system view, return user view with return command.",
"",
"",
"",
""
],
"stdout_lines": [
[
"Enter system view, return user view with return command."
],
[
""
],
[
""
],
[
""
],
[
""
]
]
}

TASK [Step6.7 Cover the unsupported device delivery interface test] *******************************************************
task path: /usr/xuyuandong/tmp/test.yml:298
<10.130.200.118> attempting to start connection
<10.130.200.118> using connection plugin network_cli
<10.130.200.118> found existing local domain socket, using it!
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
<10.130.200.118> updating play_context for connection
<10.130.200.118>
<10.130.200.118> local domain socket path is /root/.ansible/pc/28855f346b
<10.130.200.118> wrong context, sending exit to device
<10.130.200.118> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.130.200.118> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715" && echo ansible-tmp-1555417826.11-66185437939715="echo /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible-2.9.0.dev0-py2.7.egg/ansible/modules/network/cloudengine/ce_command.py
<10.130.200.118> PUT /root/.ansible/tmp/ansible-local-147Fifh53/tmpfOneGy TO /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715/AnsiballZ_ce_command.py
<10.130.200.118> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715/ /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715/AnsiballZ_ce_command.py && sleep 0'
<10.130.200.118> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-147Fifh53/ansible-tmp-1555417826.11-66185437939715/ > /dev/null 2>&1 && sleep 0'
ok: [10.130.200.118] => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"system-view",
"interface 25GE1/0/2",
"description qqqq",
"commit"
],
"host": null,
"interval": 1,
"match": "all",
"password": null,
"port": null,
"provider": null,
"retries": 10,
"ssh_keyfile": null,
"timeout": null,
"transport": null,
"use_ssl": null,
"username": null,
"validate_certs": null,
"wait_for": null
}
},
"stdout": [
"Enter system view, return user view with return command.",
"",
"",
""
],
"stdout_lines": [
[
"Enter system view, return user view with return command."
],
[
""
],
[
""
],
[
""
]
]
}
META: ran handlers
META: ran handlers

PLAY RECAP ****************************************************************************************************************
10.130.200.118 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

weixiaoxu0512 added some commits Apr 14, 2019

fix bugs for ce
Fix bugs for ce and  Compatible with Python 3.
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

@weixiaoxu0512 This PR was evaluated as a potentially problematic PR for the following reasons:

  • More than 50 changed files.

Such PR can only be merged by human. Contact a Core team member to review this PR on IRC: #ansible-devel on irc.freenode.net

click here for bot help

weixiaoxu0512 added some commits Apr 14, 2019

update for shippable
update for shippable

@weixiaoxu0512 weixiaoxu0512 changed the title [WIP] fix bugs for ce. fix bugs for ce. Apr 16, 2019

@weixiaoxu0512 weixiaoxu0512 marked this pull request as ready for review Apr 16, 2019

@sivel sivel removed the needs_triage label Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.