def run_remote_command(host_string, command, timeout=NODE_COMMAND_TIMEOUT,
jsonresult=False,
catch_exitcodes=None):
"""Executes command on remote host via fabric run.
Optionally timeout may be specified.
If result of execution is expected in json format, then the output will
be treated as json.
"""
with settings(hide(NODE_STATUSES.running, 'warnings', 'stdout', 'stderr'),
host_string=host_string,
warn_only=True):
return execute_run(command, timeout=timeout, jsonresult=jsonresult,
catch_exitcodes=catch_exitcodes)
评论列表
文章目录