Skip to content

Commit ad47ffb

Browse files
committed
Force English output for VBoxManage. Fixes #2266
1 parent 702fea8 commit ad47ffb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

gns3server/compute/virtualbox/__init__.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,16 @@ async def execute(self, subcommand, args, timeout=60):
109109
command = [vboxmanage_path, "--nologo", subcommand]
110110
command.extend(args)
111111
command_string = " ".join(command)
112+
env = os.environ.copy()
113+
env["LANG"] = "en" # force english output because we rely on it to parse the output
112114
log.info("Executing VBoxManage with command: {}".format(command_string))
113115
try:
114-
process = await asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
116+
process = await asyncio.create_subprocess_exec(
117+
*command,
118+
stdout=asyncio.subprocess.PIPE,
119+
stderr=asyncio.subprocess.PIPE,
120+
env=env
121+
)
115122
except (OSError, subprocess.SubprocessError) as e:
116123
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))
117124

0 commit comments

Comments
 (0)