Closed slientup closed 6 years ago
python下import如下报错吗? import SCPClient
不太明白你的意思,在报错的信息中我有看到这样的信息
The full traceback is:
File "/tmp/ansible_lH24EP/ansible_module_ce_file_copy.py", line 119, in
from scp import SCPClient
然后在ce_file_copy文件中看到有如下代码
import re import os import time from xml.etree import ElementTree import paramiko from ansible.module_utils.basic import get_exception, AnsibleModule from ansible.module_utils.ce import ce_argument_spec, run_commands, get_nc_config
try: from scp import SCPClient HAS_SCP = True except ImportError: HAS_SCP = False
linux下输入python,进入python视图 然后输入import SCPClient是否OK?
import SCPClient Traceback (most recent call last): File "
", line 1, in ImportError: No module named SCPClient
from scp import SCPClient试下呢? 初步看可能scp安装有些问题
from scp import SCPClient Traceback (most recent call last): File "
", line 1, in ImportError: No module named scp
得详细看下环境了。初步看可能scp安装有些问题
我重新下载了一个scp包 ,但又报新的问题处理了SSHError: Could not open connection, possibly due to unacceptable SSH subsystem name.
File "build/bdist.linux-x86_64/egg/ncclient/transport/ssh.py", line 435, in connect raise SSHError("Could not open connection, possibly due to unacceptable" SSHError: Could not open connection, possibly due to unacceptable SSH subsystem name. fatal: [192.168.107.68]: FAILED! => { "changed": false, "invocation": { "module_args": { "file_system": "flash:", "host": "192.168.107.68", "local_file": "/home/work/test.txt", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "provider": { "host": "192.168.107.68", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "timeout": null, "transport": "cli", "use_ssl": null, "username": "", "validate_certs": null }, "remote_file": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": "admin", "validate_certs": null } }, "msg": "Error: Could not open connection, possibly due to unacceptable SSH subsystem name." }
咱们可以找个时间看下,3月22日?
明天可以,你有空的时候联系我就行
已经处理,使用方法问题
使用方法问题 是啥意思。我中文不太好?能详细解释下吗?
使用方法问题 是啥意思。我中文不太好?能详细解释下吗?
这个问题已经找到了: 问题在交换机侧,需要在交换机上打上命令: scp server enable
问题解决
当然ansible 侧最好也要pip下scp这个模块
ansible 2.4.2版本 使用ce_file_copy模块进行远程上传文件时,报如下错误 The full traceback is: File "/tmp/ansible_lH24EP/ansible_module_ce_file_copy.py", line 119, in
from scp import SCPClient
fatal: [172.16.255.1]: FAILED! => { "changed": false, "invocation": { "module_args": { "file_system": "flash:", "host": null, "local_file": "/ce-save.yml", "password": null, "port": null, "provider": { "host": "172.16.255.1", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "port": 22, "timeout": null, "transport": "cli", "use_ssl": null, "username": "admin123", "validate_certs": null }, "remote_file": null, "timeout": null, "transport": "cli", "use_ssl": null, "username": null, "validate_certs": null } }, "msg": "'Error: No scp package, please install it.'" 确认ce交换机和liunx系统都有安装scp的服务,请问下大概是什么问题?