fabric连接ssh invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!

用户头像
大鱼
2019:07:12 17:09:03  阅读: 175  喜欢:
python fabric连接ssh 报错
invoke.exceptions.UnexpectedExit: Encountered a bad command exit code!
解决办法: 在run里面加参数 warn=True
 connect_ = fabric.Connection(host, user=user, connect_kwargs=connect_kwargs)
 data = connect_.run('display  device', warn=True,  watchers=[sudopass])
新的评论