我只是想在没有这些东西sudo('supervisorctl')的情况下在远程服务器上的结构中运行 shell 程序() 。[host asdf] out:
我可以,open_shell("sudo supervisorctrl")但这给了我 motd 和 shell 的其余部分。
谢谢。
您可以将settings 上下文管理器与hide:
from fabric.api import task, settings, hide
@task
def whatevs():
with settings(hide('commands')):
sudo('sudo supervisorctl')
有关 hide 可以在此处获取的“输出级别”的更多信息。