1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-29 02:08:10 +00:00

Successfully create an iou device from the GUI via HTTP

This commit is contained in:
Julien Duponchelle 2015-02-12 17:03:01 +01:00
parent 4689024b50
commit 05df7001a3
3 changed files with 19 additions and 12 deletions

View File

@ -108,7 +108,6 @@ def parse_arguments(argv, config):
parser.add_argument("-d", "--debug", action="store_true", help="show debug logs")
parser.add_argument("--live", action="store_true", help="enable code live reload")
return parser.parse_args(argv)

View File

@ -193,7 +193,6 @@ class IOUVM(BaseVM):
"vm_id": self.id,
"console": self._console,
"project_id": self.project.id,
"iourc_path": self._iourc_path,
"path": self.path
}
@ -268,7 +267,7 @@ class IOUVM(BaseVM):
# TODO: ASYNC
# self._library_check()
if not self._iourc_path or not os.path.isfile(self._iourc_path):
if self._iourc_path and not os.path.isfile(self._iourc_path):
raise IOUError("A valid iourc file is necessary to start IOU")
iouyap_path = self.iouyap_path
@ -278,7 +277,8 @@ class IOUVM(BaseVM):
self._create_netmap_config()
# created a environment variable pointing to the iourc file.
env = os.environ.copy()
env["IOURC"] = self._iourc_path
if self._iourc_path:
env["IOURC"] = self._iourc_path
self._command = self._build_command()
try:
log.info("Starting IOU: {}".format(self._command))

View File

@ -52,7 +52,7 @@ IOU_CREATE_SCHEMA = {
},
},
"additionalProperties": False,
"required": ["name", "path", "iourc_path"]
"required": ["name", "path"]
}
IOU_UPDATE_SCHEMA = {
@ -73,12 +73,24 @@ IOU_UPDATE_SCHEMA = {
},
"path": {
"description": "Path of iou binary",
"type": "string"
"type": ["string", "null"]
},
"iourc_path": {
"description": "Path of iourc",
"type": "string"
"type": ["string", "null"]
},
"initial_config": {
"description": "Initial configuration path",
"type": ["string", "null"]
},
"serial_adapters": {
"description": "How many serial adapters are connected to the IOU",
"type": ["integer", "null"]
},
"ethernet_adapters": {
"description": "How many ethernet adapters are connected to the IOU",
"type": ["integer", "null"]
}
},
"additionalProperties": False,
}
@ -117,11 +129,7 @@ IOU_OBJECT_SCHEMA = {
"description": "Path of iou binary",
"type": "string"
},
"iourc_path": {
"description": "Path of iourc",
"type": "string"
},
},
"additionalProperties": False,
"required": ["name", "vm_id", "console", "project_id", "path", "iourc_path"]
"required": ["name", "vm_id", "console", "project_id", "path"]
}