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
@@ -346,7 +346,7 @@ class VPCSDevice(object):
|
||||
raise VPCSError("VPCS executable version must be >= 0.5b1")
|
||||
else:
|
||||
raise VPCSError("Could not determine the VPCS version for {}".format(self._path))
|
||||
except (OSError, subprocess.CalledProcessError) as e:
|
||||
except subprocess.SubprocessError as e:
|
||||
raise VPCSError("Error while looking for the VPCS version: {}".format(e))
|
||||
|
||||
def start(self):
|
||||
@@ -386,7 +386,7 @@ class VPCSDevice(object):
|
||||
creationflags=flags)
|
||||
log.info("VPCS instance {} started PID={}".format(self._id, self._process.pid))
|
||||
self._started = True
|
||||
except OSError as e:
|
||||
except subprocess.SubprocessError as e:
|
||||
vpcs_stdout = self.read_vpcs_stdout()
|
||||
log.error("could not start VPCS {}: {}\n{}".format(self._path, e, vpcs_stdout))
|
||||
raise VPCSError("could not start VPCS {}: {}\n{}".format(self._path, e, vpcs_stdout))
|
||||
|
||||
Reference in new issue
Block a user