mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Changes how to look for vpcs and iouyap locations.
This commit is contained in:
1 parent
e41afbb5c6
commit
119eb635cf
3 files changed
+24
-24
No files matched your search
@@ -69,18 +69,15 @@ class IOU(IModule):
|
||||
iou_config = config.get_section_config(name.upper())
|
||||
self._iouyap = iou_config.get("iouyap")
|
||||
if not self._iouyap or not os.path.isfile(self._iouyap):
|
||||
iouyap_in_cwd = os.path.join(os.getcwd(), "iouyap")
|
||||
if os.path.isfile(iouyap_in_cwd):
|
||||
self._iouyap = iouyap_in_cwd
|
||||
else:
|
||||
# look for iouyap if none is defined or accessible
|
||||
for path in os.environ["PATH"].split(":"):
|
||||
try:
|
||||
if "iouyap" in os.listdir(path) and os.access(os.path.join(path, "iouyap"), os.X_OK):
|
||||
self._iouyap = os.path.join(path, "iouyap")
|
||||
break
|
||||
except OSError:
|
||||
continue
|
||||
paths = [os.getcwd()] + os.environ["PATH"].split(":")
|
||||
# look for iouyap in the current working directory and $PATH
|
||||
for path in paths:
|
||||
try:
|
||||
if "iouyap" in os.listdir(path) and os.access(os.path.join(path, "iouyap"), os.X_OK):
|
||||
self._iouyap = os.path.join(path, "iouyap")
|
||||
break
|
||||
except OSError:
|
||||
continue
|
||||
|
||||
if not self._iouyap:
|
||||
log.warning("iouyap binary couldn't be found!")
|
||||
|
||||
Reference in new issue
Block a user