提交 59b8a35f 编写于 作者: L lolyu

utils.service: enforce uniform return string type

ensure returns of service manager to be of type 'str'.
Signed-off-by: Nlolyu <lolyu@redhat.com>
上级 b06b87ec
......@@ -153,7 +153,7 @@ def sys_v_init_result_parser(command):
status_per_target_dict = {}
# Dict to store the status for service based on xinetd.
xinet_services_dict = {}
lines = cmd_result.stdout.strip().splitlines()
lines = cmd_result.stdout_text.strip().splitlines()
for line in lines:
sublines = line.strip().split()
if len(sublines) == 8:
......@@ -231,7 +231,7 @@ def systemd_result_parser(command):
raise process.CmdError(cmd_result.command, cmd_result)
# Dict to store service name to status.
_service2status_dict = {}
lines = cmd_result.stdout.strip().splitlines()
lines = cmd_result.stdout_text.strip().splitlines()
for line in lines:
sublines = line.strip().split()
if ((not len(sublines) == 2) or
......
......@@ -190,7 +190,7 @@ class TestSystemdServiceManager(TestServiceManager):
def test_list(self):
list_result_mock = mock.Mock(exit_status=0,
stdout="sshd.service enabled\n"
stdout_text="sshd.service enabled\n"
"vsftpd.service disabled\n"
"systemd-sysctl.service static\n")
run_mock = mock.Mock(return_value=list_result_mock)
......@@ -254,7 +254,7 @@ class TestSysVInitServiceManager(TestServiceManager):
def test_list(self):
list_result_mock = mock.Mock(
exit_status=0,
stdout="sshd 0:off 1:off "
stdout_text="sshd 0:off 1:off "
"2:off 3:off 4:off 5:off 6:off\n"
"vsftpd 0:off 1:off 2:off "
" 3:off 4:off 5:on 6:off\n"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册