mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 09:18:08 +00:00
Fixes call to export project.
This commit is contained in:
parent
16b5bb8810
commit
76cc1d2750
@ -368,7 +368,7 @@ class ProjectHandler:
|
|||||||
response.content_length = None
|
response.content_length = None
|
||||||
response.start(request)
|
response.start(request)
|
||||||
|
|
||||||
for data in project.export(include_images=bool(request.GET.get("images", "0"))):
|
for data in project.export(include_images=bool(request.GET.get("include_images", "0"))):
|
||||||
response.write(data)
|
response.write(data)
|
||||||
yield from response.drain()
|
yield from response.drain()
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ from gns3server.utils import parse_version
|
|||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
from ..base_manager import BaseManager
|
from ..base_manager import BaseManager
|
||||||
from ..project_manager import ProjectManager
|
|
||||||
from .docker_vm import DockerVM
|
from .docker_vm import DockerVM
|
||||||
from .docker_error import *
|
from .docker_error import *
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ class Docker(BaseManager):
|
|||||||
raise DockerError("Can't connect to docker daemon")
|
raise DockerError("Can't connect to docker daemon")
|
||||||
|
|
||||||
if parse_version(version["ApiVersion"]) < parse_version(DOCKER_MINIMUM_API_VERSION):
|
if parse_version(version["ApiVersion"]) < parse_version(DOCKER_MINIMUM_API_VERSION):
|
||||||
raise DockerError("Docker API version is {}. But GNS3 require a minimum API version {}".format(version["ApiVersion"], DOCKER_MINIMUM_API_VERSION))
|
raise DockerError("Docker API version is {}. GNS3 requires a minimum API version of {}".format(version["ApiVersion"], DOCKER_MINIMUM_API_VERSION))
|
||||||
return self._connector
|
return self._connector
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
@ -594,7 +594,7 @@ class Project:
|
|||||||
for prop, value in node["properties"].items():
|
for prop, value in node["properties"].items():
|
||||||
if prop.endswith("image"):
|
if prop.endswith("image"):
|
||||||
node["properties"][prop] = os.path.basename(value)
|
node["properties"][prop] = os.path.basename(value)
|
||||||
if include_images:
|
if include_images is True:
|
||||||
self._export_images(value, node["type"], z)
|
self._export_images(value, node["type"], z)
|
||||||
z.writestr("project.gns3", json.dumps(topology).encode())
|
z.writestr("project.gns3", json.dumps(topology).encode())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user