mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-12 11:28:55 +00:00
Fix import/export of dynamips configuration
This commit is contained in:
parent
63b888a57e
commit
96194cef67
@ -344,9 +344,6 @@ class NodeHandler:
|
|||||||
raise aiohttp.web.HTTPForbidden
|
raise aiohttp.web.HTTPForbidden
|
||||||
|
|
||||||
node_type = node.node_type
|
node_type = node.node_type
|
||||||
if node_type == "dynamips":
|
|
||||||
path = "/project-files/{}/{}".format(node_type, path)
|
|
||||||
else:
|
|
||||||
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
|
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
|
||||||
|
|
||||||
res = yield from node.compute.http_query("GET", "/projects/{project_id}/files{path}".format(project_id=project.id, path=path), timeout=None, raw=True)
|
res = yield from node.compute.http_query("GET", "/projects/{project_id}/files{path}".format(project_id=project.id, path=path), timeout=None, raw=True)
|
||||||
@ -384,12 +381,9 @@ class NodeHandler:
|
|||||||
raise aiohttp.web.HTTPForbidden
|
raise aiohttp.web.HTTPForbidden
|
||||||
|
|
||||||
node_type = node.node_type
|
node_type = node.node_type
|
||||||
if node_type == "dynamips":
|
|
||||||
path = "/project-files/{}/{}".format(node_type, path)
|
|
||||||
else:
|
|
||||||
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
|
path = "/project-files/{}/{}/{}".format(node_type, node.id, path)
|
||||||
|
|
||||||
data = yield from request.content.read()
|
data = yield from request.content.read()
|
||||||
|
|
||||||
res = yield from node.compute.http_query("POST", "/projects/{project_id}/files{path}".format(project_id=project.id, path=path), data=data, timeout=None, raw=True)
|
yield from node.compute.http_query("POST", "/projects/{project_id}/files{path}".format(project_id=project.id, path=path), data=data, timeout=None, raw=True)
|
||||||
response.set_status(201)
|
response.set_status(201)
|
||||||
|
Loading…
Reference in New Issue
Block a user