mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Remove running VBoxManage as another user option (root for instance). See #248.
This commit is contained in:
parent
65953847f6
commit
8e652778f9
@ -95,12 +95,6 @@ class VirtualBox(BaseManager):
|
|||||||
command_string = " ".join(command)
|
command_string = " ".join(command)
|
||||||
log.info("Executing VBoxManage with command: {}".format(command_string))
|
log.info("Executing VBoxManage with command: {}".format(command_string))
|
||||||
try:
|
try:
|
||||||
vbox_user = self.config.get_section_config("VirtualBox").get("vbox_user")
|
|
||||||
if vbox_user:
|
|
||||||
# TODO: test & review this part
|
|
||||||
sudo_command = "sudo -i -u {} ".format(vbox_user) + " ".join(command)
|
|
||||||
process = yield from asyncio.create_subprocess_shell(sudo_command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
|
||||||
else:
|
|
||||||
process = yield from asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
process = yield from asyncio.create_subprocess_exec(*command, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE)
|
||||||
except (OSError, subprocess.SubprocessError) as e:
|
except (OSError, subprocess.SubprocessError) as e:
|
||||||
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))
|
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user