aboutsummaryrefslogtreecommitdiffstats
path: root/community/gns3-server
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-12-18 15:12:05 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-12-18 15:12:05 +0000
commit0d44bca5f6170a245426d62baeb0d7fab4371f6c (patch)
tree52613004f86fe8cd655adf3257f22a49e0003f42 /community/gns3-server
parent50c5e2f32519a20c2bdcb3e7cf03ff93fef34297 (diff)
downloadaports-0d44bca5f6170a245426d62baeb0d7fab4371f6c.tar.bz2
aports-0d44bca5f6170a245426d62baeb0d7fab4371f6c.tar.xz
community/gns3-server: aiohttp support added from upstream
Diffstat (limited to 'community/gns3-server')
-rw-r--r--community/gns3-server/APKBUILD10
-rw-r--r--community/gns3-server/aiohttp-support.patch61
-rw-r--r--community/gns3-server/dropped-requirements.patch2
3 files changed, 67 insertions, 6 deletions
diff --git a/community/gns3-server/APKBUILD b/community/gns3-server/APKBUILD
index cfae03a447..7de1b648cf 100644
--- a/community/gns3-server/APKBUILD
+++ b/community/gns3-server/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=gns3-server
pkgver=2.1.0
-pkgrel=2
+pkgrel=3
pkgdesc="GNS3 network simulator. Server package."
url="https://github.com/GNS3/gns3-server"
arch="all"
@@ -13,8 +13,8 @@ depends="busybox dynamips python3 py3-psutil py3-jinja2 py3-aiohttp
makedepends="busybox-static py-setuptools python3-dev linux-headers py3-pytest"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/GNS3/$pkgname/archive/v$pkgver.tar.gz
- gns3-server-aiohttp.patch
- dropped-requirements.patch"
+ dropped-requirements.patch
+ aiohttp-support.patch"
builddir="$srcdir"/$pkgname-$pkgver
build() {
@@ -52,5 +52,5 @@ EOF
}
sha512sums="fe85cee40308912c1b530e74301302cdbc44c60092f245cf87da4ee1355dc577c69d6f2c4f6c2018208c425e1b7e51671397494b73c810b6cde8a35c07a0bff3 gns3-server-2.1.0.tar.gz
-4e0c181253e2c055d5e6f10a2bc8b93bbb0dfb42479d1b12cf83049648136745666b4388d6a971a9b8ace4c3980ce8f9ff7d24e113b126fe1a466412ec2a9254 gns3-server-aiohttp.patch
-48ecf257b4ce7d960c0040b516285d592490a6e7c98598a0c08583c68609d3123d6e53ef7ebd8e52f603c3159951fe402607601934eaf5d18deca83ba8fa92ba dropped-requirements.patch"
+2a9339bc681cd4c670e622ec331af77d41d6e5311f694ed7d39bdad70e6c3fe1ac7e387393b4765aafb3d7388656e9ddf9069640e4de54d59632b5d2a9a94994 dropped-requirements.patch
+761956ae0870bd734c6bc30b7297f624d33b37082a26b2227395606fdd373b7946f132f8fcb2fe2d6dddeb5ad91f6c7506905ff63faea6e10b823ece203b67a1 aiohttp-support.patch"
diff --git a/community/gns3-server/aiohttp-support.patch b/community/gns3-server/aiohttp-support.patch
new file mode 100644
index 0000000000..83bb6ee733
--- /dev/null
+++ b/community/gns3-server/aiohttp-support.patch
@@ -0,0 +1,61 @@
+From a7412d1c879920c3b2c2871763aafbe6836d1ed7 Mon Sep 17 00:00:00 2001
+From: ziajka <dominik@gns3.net>
+Date: Thu, 26 Oct 2017 16:29:01 +0200
+Subject: [PATCH] aiohttp 2.3.1 dependency
+
+---
+ gns3server/controller/compute.py | 8 +++++++-
+ gns3server/web/web_server.py | 11 ++++++++---
+ requirements.txt | 2 +-
+ 3 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/gns3server/controller/compute.py b/gns3server/controller/compute.py
+index 05154fd3..8a3d35e8 100644
+--- a/gns3server/controller/compute.py
++++ b/gns3server/controller/compute.py
+@@ -506,10 +506,16 @@ def _run_http_query(self, method, path, data=None, timeout=20, raw=False):
+ else:
+ data = json.dumps(data).encode("utf-8")
+ try:
++ log.debug("Attempting request to compute: {method} {url} {headers}".format(
++ method=method,
++ url=url,
++ headers=headers
++ ))
+ response = yield from self._session().request(method, url, headers=headers, data=data, auth=self._auth, chunked=chunked, timeout=timeout)
+ except asyncio.TimeoutError as e:
+ raise ComputeError("Timeout error when connecting to {}".format(url))
+- except (aiohttp.ClientError, aiohttp.ServerDisconnectedError, ValueError, KeyError) as e:
++ except (aiohttp.ClientError, aiohttp.ServerDisconnectedError, ValueError, KeyError, socket.gaierror) as e:
++ # aiohttp 2.3.1 raises socket.gaierror when cannot find host
+ raise ComputeError(str(e))
+ body = yield from response.read()
+ if body and not raw:
+diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py
+index 40179367..9ce9c2e0 100644
+--- a/gns3server/web/web_server.py
++++ b/gns3server/web/web_server.py
+@@ -43,8 +43,8 @@
+ import logging
+ log = logging.getLogger(__name__)
+
+-if not aiohttp.__version__.startswith("2.2"):
+- raise RuntimeError("aiohttp 2.2 is required to run the GNS3 server")
++if not (aiohttp.__version__.startswith("2.2") or aiohttp.__version__.startswith("2.3")):
++ raise RuntimeError("aiohttp 2.2.x or 2.3.x is required to run the GNS3 server")
+
+
+ class WebServer:
+@@ -102,7 +102,12 @@ def shutdown_server(self):
+ if self._app:
+ yield from self._app.shutdown()
+ if self._handler:
+- yield from self._handler.finish_connections(2) # Parameter is timeout
++ try:
++ # aiohttp < 2.3
++ yield from self._handler.finish_connections(2) # Parameter is timeout
++ except AttributeError:
++ # aiohttp >= 2.3
++ yield from self._handler.shutdown(2) # Parameter is timeout
+ if self._app:
+ yield from self._app.cleanup()
diff --git a/community/gns3-server/dropped-requirements.patch b/community/gns3-server/dropped-requirements.patch
index f658454f8a..243de045a8 100644
--- a/community/gns3-server/dropped-requirements.patch
+++ b/community/gns3-server/dropped-requirements.patch
@@ -5,7 +5,7 @@ index 2d88225..92b19c4 100644
@@ -1,11 +1,11 @@
jsonschema>=2.4.0
-aiohttp>=2.2.0,<2.3.0 # pyup: ignore
-+aiohttp>=2.2.0,<2.3.4 # pyup: ignore
++aiohttp>=2.3.0,<2.4.0 # pyup: ignore
aiohttp-cors>=0.5.3,<0.6.0 # pyup: ignore
-yarl>=0.11,<0.12 # pyup: ignore
+yarl>=0.15 # pyup: ignore