diff --git a/gns3/spice_console.py b/gns3/spice_console.py index 1873477f5..88739b22a 100644 --- a/gns3/spice_console.py +++ b/gns3/spice_console.py @@ -71,10 +71,10 @@ def spiceConsole(node, port, command): log.debug('starting SPICE program "{}"'.format(command)) if sys.platform.startswith("win"): # use the string on Windows - subprocess.call(command, env=os.environ) + subprocess.Popen(command, env=os.environ) else: # use arguments on other platforms args = shlex.split(command) - subprocess.call(args, env=os.environ) + subprocess.Popen(args, env=os.environ) except (OSError, ValueError, subprocess.SubprocessError) as e: log.error("Could not start SPICE program with command '{}': {}".format(command, e)) diff --git a/gns3/telnet_console.py b/gns3/telnet_console.py index d4a3312e1..46660438d 100644 --- a/gns3/telnet_console.py +++ b/gns3/telnet_console.py @@ -87,7 +87,7 @@ def exec_command(self, command): if sys.platform.startswith("win"): # use the string on Windows - subprocess.call(command, env=os.environ) + subprocess.Popen(command, env=os.environ) else: # use arguments on other platforms try: @@ -102,7 +102,7 @@ def exec_command(self, command): # inject gnome-terminal environment variables if "GNOME_TERMINAL_SERVICE" not in env or "GNOME_TERMINAL_SCREEN" not in env: env.update(gnome_terminal_env()) - subprocess.call(args, env=env) + subprocess.Popen(args, env=env) def run(self): diff --git a/gns3/vnc_console.py b/gns3/vnc_console.py index 509e06fa7..75c812443 100644 --- a/gns3/vnc_console.py +++ b/gns3/vnc_console.py @@ -68,10 +68,10 @@ def vncConsole(node, port, command): log.debug('starting VNC program "{}"'.format(command)) if sys.platform.startswith("win"): # use the string on Windows - subprocess.call(command, env=os.environ) + subprocess.Popen(command, env=os.environ) else: # use arguments on other platforms args = shlex.split(command) - subprocess.call(args, env=os.environ) + subprocess.Popen(args, env=os.environ) except (OSError, ValueError, subprocess.SubprocessError) as e: log.error("Could not start VNC program with command '{}': {}".format(command, e)) diff --git a/tests/test_spice_console.py b/tests/test_spice_console.py index b17ca0890..792d852b7 100644 --- a/tests/test_spice_console.py +++ b/tests/test_spice_console.py @@ -34,7 +34,7 @@ def test_spice_console_on_linux_and_mac(vpcs_device): def test_spice_console_on_windows(vpcs_device): - with patch('subprocess.call') as p, \ + with patch('subprocess.Popen') as p, \ patch('sys.platform', new="win"): vpcs_device.settings()["console_host"] = "localhost" spiceConsole(vpcs_device, '2525', 'command %h %p') diff --git a/tests/test_vnc_console.py b/tests/test_vnc_console.py index d095803f3..b963867bb 100644 --- a/tests/test_vnc_console.py +++ b/tests/test_vnc_console.py @@ -23,7 +23,7 @@ def test_vnc_console_on_linux_and_mac(vpcs_device): - with patch('subprocess.call') as p, \ + with patch('subprocess.Popen') as p, \ patch('sys.platform', new="linux"): vpcs_device.settings()["console_host"] = "localhost" vncConsole(vpcs_device, 6000, 'command %h %p %D') @@ -34,7 +34,7 @@ def test_vnc_console_on_linux_and_mac(vpcs_device): def test_vnc_console_on_windows(vpcs_device): - with patch('subprocess.call') as p, \ + with patch('subprocess.Popen') as p, \ patch('sys.platform', new="win"): vpcs_device.settings()["console_host"] = "localhost" vncConsole(vpcs_device, 6000, 'command %h %p %D') @@ -44,7 +44,7 @@ def test_vnc_console_on_windows(vpcs_device): # def test_vnc_console_on_linux_with_popen_issues(vpcs_device): -# with patch('subprocess.call', side_effect=subprocess.SubprocessError()), \ +# with patch('subprocess.Popen', side_effect=subprocess.SubprocessError()), \ # patch('sys.platform', new="linux"): # vpcs_device.settings()["console_host"] = "localhost" #