提交 cb17bd2a 编写于 作者: H Hao Liu

avocado.utils.service: Check stderr when service do not exists

When using a system V init service manager to check an unavailable
package, the error messages are sent via stderr, not stdout.
Signed-off-by: NHao Liu <hliu@redhat.com>
上级 00e09e39
......@@ -117,11 +117,11 @@ def sys_v_init_result_parser(command):
"""
# If service is stopped, exit_status is also not zero.
# So, we can't use exit_status to check result.
output = cmd_result.stdout.lower()
# Returns None if XXX is unrecognized.
if re.search(r"unrecognized", output):
if re.search(r"unrecognized", cmd_result.stderr.lower()):
return None
# Returns False if XXX is stopped.
output = cmd_result.stdout.lower()
dead_flags = [r"stopped", r"not running", r"dead"]
for flag in dead_flags:
if re.search(flag, output):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册