mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Use SubprocessError to catch Subprocess exceptions.
This commit is contained in:
1 parent
3bd88178a0
commit
09948a366f
7 files changed
+14
-16
No files matched your search
@@ -717,10 +717,8 @@ class VirtualBox(IModule):
|
||||
|
||||
try:
|
||||
result = subprocess.check_output(command, stderr=subprocess.STDOUT, universal_newlines=True, timeout=30)
|
||||
except subprocess.CalledProcessError as e:
|
||||
except subprocess.SubprocessError as e:
|
||||
raise VirtualBoxError("Could not execute VBoxManage {}".format(e))
|
||||
except subprocess.TimeoutExpired:
|
||||
raise VirtualBoxError("VBoxManage has timed out")
|
||||
return result
|
||||
|
||||
@IModule.route("virtualbox.vm_list")
|
||||
|
||||
@@ -558,8 +558,8 @@ class VirtualBoxVM(object):
|
||||
raise VirtualBoxError("{}".format(virtualbox_error))
|
||||
else:
|
||||
raise VirtualBoxError("{}".format(e))
|
||||
except subprocess.TimeoutExpired:
|
||||
raise VirtualBoxError("VBoxManage has timed out")
|
||||
except subprocess.SubprocessError as e:
|
||||
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))
|
||||
return result.splitlines()
|
||||
|
||||
def _get_vm_info(self):
|
||||
|
||||
Reference in new issue
Block a user