From 0078259e5eecee5439e0ef013b64235e4db91c76 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 17 Feb 2020 21:20:22 +0100 Subject: ssh: get_config_value() should return str not list --- scripts/cli/test_service_ssh.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/cli/test_service_ssh.py b/scripts/cli/test_service_ssh.py index f0ad2e565..40e1433b2 100755 --- a/scripts/cli/test_service_ssh.py +++ b/scripts/cli/test_service_ssh.py @@ -28,7 +28,8 @@ base_path = ['service', 'ssh'] def get_config_value(key): tmp = read_file(SSHD_CONF) - return re.findall(r'\n?{}\s+(.*)'.format(key), tmp) + tmp = re.findall(r'\n?{}\s+(.*)'.format(key), tmp) + return tmp[0] class TestServiceSSH(unittest.TestCase): @@ -53,11 +54,11 @@ class TestServiceSSH(unittest.TestCase): self.session.commit() # Check configured port - port = get_config_value('Port')[0] + port = get_config_value('Port') self.assertTrue("2222" in port) # Check DNS usage - dns = get_config_value('UseDNS')[0] + dns = get_config_value('UseDNS') self.assertTrue("no" in dns) # Check for running process -- cgit v1.2.3