IOURC is a text box instead of a file path

Fix https://github.com/GNS3/gns3-gui/issues/1662
This commit is contained in:
Julien Duponchelle committed 2016-11-21 18:16:50 +01:00
1 parent 9be293909e
commit a853e87fa5
3 files changed
+28 -5

No files matched your search

+4 -4
View File
@@ -224,6 +224,10 @@ class IOUVM(BaseNode):
iourc_path = self._config().get("iourc_path")
if not iourc_path:
# look for the iourc file in the temporary dir.
path = os.path.join(self.temporary_directory, "iourc")
if os.path.exists(path):
return path
# look for the iourc file in the user home dir.
path = os.path.join(os.path.expanduser("~/"), ".iourc")
if os.path.exists(path):
@@ -232,10 +236,6 @@ class IOUVM(BaseNode):
path = os.path.join(self.working_dir, "iourc")
if os.path.exists(path):
return path
# look for the iourc file in the temporary dir.
path = os.path.join(self.temporary_directory, "iourc")
if os.path.exists(path):
return path
return iourc_path
@property
+9 -1
View File
@@ -387,7 +387,15 @@ class Node:
Start a node
"""
try:
yield from self.post("/start", timeout=240)
# For IOU we need to send the licence everytime
if self.node_type == "iou":
try:
licence = self._project.controller.settings["IOU"]["iourc_content"]
except KeyError:
raise aiohttp.web.HTTPConflict(text="IOU licence is not configured")
yield from self.post("/start", timeout=240, data={"iourc_content": licence})
else:
yield from self.post("/start", timeout=240)
except asyncio.TimeoutError:
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when starting {}".format(self._name))