Catch OSError exception for subprocess calls.

This commit is contained in:
Jeremy committed 2014-12-11 12:15:24 -07:00
1 parent acb5103119
commit 7f37f649da
6 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -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()