Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ssh/azext_ssh/ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def start_ssh_connection(ip, username, cert_file, private_key_file):
command = [_get_ssh_path(), _get_host(username, ip)]
command = command + _build_args(cert_file, private_key_file)
logger.debug("Running ssh command %s", ' '.join(command))
subprocess.call(command, shell=True)
subprocess.call(command, shell=platform.system() == 'Windows')


def write_ssh_config(config_path, resource_group, vm_name,
Expand Down
3 changes: 2 additions & 1 deletion src/ssh/azext_ssh/tests/latest/test_ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from knack import util
import mock
import unittest
import platform

from azext_ssh import ssh_utils

Expand All @@ -26,7 +27,7 @@ def test_start_ssh_connection(self, mock_call, mock_build, mock_host, mock_path)
mock_path.assert_called_once_with()
mock_host.assert_called_once_with("user", "ip")
mock_build.assert_called_once_with("cert", "private")
mock_call.assert_called_once_with(expected_command, shell=True)
mock_call.assert_called_once_with(expected_command, shell=platform.system() == 'Windows')

@mock.patch('azext_ssh.ssh_utils.file_utils.make_dirs_for_file')
def test_write_ssh_config_ip_and_vm(self, mock_make_dirs):
Expand Down