Merge "Fix RemoteClient having bad default ssh_shell_prologue"

This commit is contained in:
Jenkins
2017-08-23 07:24:20 +00:00
committed by Gerrit Code Review
3 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
---
fixes:
- |
Fix RemoteClient default ssh_shell_prologue: Bug#1707478
The default ssh_shell_proloque has been modified from
specifying erroneous PATH=$$PATH:/sbin to PATH=$PATH:/sbin.

View File

@@ -67,7 +67,7 @@ class RemoteClient(object):
def __init__(self, ip_address, username, password=None, pkey=None,
server=None, servers_client=None, ssh_timeout=300,
connect_timeout=60, console_output_enabled=True,
ssh_shell_prologue="set -eu -o pipefail; PATH=$$PATH:/sbin;",
ssh_shell_prologue="set -eu -o pipefail; PATH=$PATH:/sbin;",
ping_count=1, ping_size=56):
"""Executes commands in a VM over ssh

View File

@@ -34,7 +34,7 @@ class TestRemoteClient(base.TestCase):
client = remote_client.RemoteClient('192.168.1.10', 'username')
client.exec_command('ls')
mock_ssh_exec_command.assert_called_once_with(
'set -eu -o pipefail; PATH=$$PATH:/sbin; ls')
'set -eu -o pipefail; PATH=$PATH:/sbin; ls')
@mock.patch.object(ssh.Client, 'test_connection_auth')
def test_validate_authentication(self, mock_test_connection_auth):