From 183ccc64b102410c716e21bb9439fb8d21e31488 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 7 Jul 2020 01:04:59 +0200 Subject: [PATCH] Some improvements (#8132) Short PR to improve some things during snap builds: * cleanup snapcraft assets before a build, in order to avoid some weird errors when two builds are executed consecutively without cleanup * use python3 explicitly in `tools/simple_http_server.py` because on several recent distributions, `python` binary is not exposed anymore, only `python2` or `python3`. --- snap/local/build.sh | 2 +- tools/simple_http_server.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/snap/local/build.sh b/snap/local/build.sh index bbe5ba323..eccb99760 100755 --- a/snap/local/build.sh +++ b/snap/local/build.sh @@ -39,4 +39,4 @@ docker run \ -w "/certbot" \ -e "PIP_EXTRA_INDEX_URL=http://localhost:8080" \ "adferrand/snapcraft:${DOCKER_ARCH}-stable" \ - snapcraft + bash -c "snapcraft clean && snapcraft" diff --git a/tools/simple_http_server.py b/tools/simple_http_server.py index 24c55962d..32f35ec69 100755 --- a/tools/simple_http_server.py +++ b/tools/simple_http_server.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """A version of Python's SimpleHTTPServer that flushes its output.""" import sys @@ -8,6 +8,7 @@ except ImportError: from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler + def serve_forever(port=0): """Spins up an HTTP server on all interfaces and the given port.