使用Paramiko执行的命令不会产生任何输出
当我尝试这样做时,
stdin, stdout, stderr = client1.exec_command('glass-version')
print stdout.readlines()
我将获得空输出。
预期的输出是:
===================== GLASS version details =====================
GLASS version : 1.2.3
=================================================================
When I try to do
stdin, stdout, stderr = client1.exec_command('glass-version')
print stdout.readlines()
I am getting an empty output.
An expected output is:
===================== GLASS version details =====================
GLASS version : 1.2.3
=================================================================
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在
stdout
上没有输出,则通常是因为命令无法启动。阅读
stderr
检查是否有任何错误。错误通常是“< command>找不到” 。为此,请参见
时,某些Unix命令失败了”
当使用Python paramiko exec_command执行 设备,另请参阅使用paramiko exec_command上的执行命令在设备上不起作用。
If you get no output on
stdout
, it is usually because the command fails to start.Read
stderr
to check for any errors.Quite often the error is "<command> not found". For that see
Some Unix commands fail with "<command> not found", when executed using Python Paramiko exec_command
If you are connecting to a device, see also Executing command using Paramiko exec_command on device is not working.