未验证 提交 51769090 编写于 作者: Y Yu Yihuang 提交者: GitHub

Merge pull request #2314 from PaulYuuu/ping_ext_host

ping.ext_host: Only execute ext_host_get_cmd when it is not empty
......@@ -68,13 +68,14 @@ def run(test, params, env):
if ping_ext_host:
ext_host = params.get("ext_host", "")
ext_host_get_cmd = params.get("ext_host_get_cmd", "")
try:
ext_host = process.system_output(ext_host_get_cmd, shell=True)
ext_host = ext_host.decode()
except process.CmdError:
logging.warn("Can't get specified host with cmd '%s',"
" Fallback to default host '%s'",
ext_host_get_cmd, ext_host)
if ext_host_get_cmd:
try:
ext_host = process.system_output(ext_host_get_cmd, shell=True)
ext_host = ext_host.decode()
except process.CmdError:
logging.warn("Can't get specified host with cmd '%s',"
" Fallback to default host '%s'",
ext_host_get_cmd, ext_host)
dest_ips = [ext_host]
sessions = [session]
interfaces = [None]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册