mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Catch OSError exception for subprocess calls.
This commit is contained in:
1 parent
acb5103119
commit
7f37f649da
6 files changed
+13
-13
No files matched your search
@@ -722,7 +722,7 @@ class VirtualBox(IModule):
|
||||
|
||||
try:
|
||||
result = subprocess.check_output(command, stderr=subprocess.STDOUT, timeout=30)
|
||||
except subprocess.SubprocessError as e:
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
raise VirtualBoxError("Could not execute VBoxManage {}".format(e))
|
||||
return result.decode("utf-8")
|
||||
|
||||
|
||||
@@ -558,7 +558,7 @@ class VirtualBoxVM(object):
|
||||
raise VirtualBoxError("{}".format(virtualbox_error))
|
||||
else:
|
||||
raise VirtualBoxError("{}".format(e))
|
||||
except subprocess.SubprocessError as e:
|
||||
except (OSError, subprocess.SubprocessError) as e:
|
||||
raise VirtualBoxError("Could not execute VBoxManage: {}".format(e))
|
||||
return result.decode("utf-8").splitlines()
|
||||
|
||||
|
||||
Reference in new issue
Block a user