Use compatible shlex_quote to handle case where Windows needs double quotes around file names, not single quotes. Ref https://github.com/GNS3/gns3-gui/issues/2866

This commit is contained in:
grossmj committed 2019-10-09 17:02:30 +08:00
1 parent 9d47050dff
commit 7cfd0d4d1d
4 files changed
+19 -8

No files matched your search

+2 -3
View File
@@ -27,12 +27,11 @@ import asyncio
import subprocess
import logging
import codecs
import shlex
from collections import OrderedDict
from gns3server.utils.interfaces import interfaces
from gns3server.utils.asyncio import subprocess_check_output
from gns3server.utils import parse_version
from gns3server.utils import parse_version, shlex_quote
log = logging.getLogger(__name__)
@@ -387,7 +386,7 @@ class VMware(BaseManager):
command = [vmrun_path, "-T", self.host_type, subcommand]
command.extend(args)
command_string = " ".join([shlex.quote(c) for c in command])
command_string = " ".join([shlex_quote(c) for c in command])
log.log(log_level, "Executing vmrun with command: {}".format(command_string))
try:
process = await asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)