Fix RemoteClient having bad default ssh_shell_prologue

Change-Id: I0e73b8deedf4bf78481cdf09b863dc149a70e9be
Closes-Bug: #1707478
This commit is contained in:
Kris Stercxk 2017-07-30 09:44:12 +02:00 committed by Kris Sterckx
parent e669940831
commit d8152de0da
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):