diff --git a/contrib/copy-packages b/contrib/copy-packages index 69282e35b..24ad42482 100644 --- a/contrib/copy-packages +++ b/contrib/copy-packages @@ -42,7 +42,7 @@ def main(): download_urls['downloads/' + version['filename']] = version['download_url'] for filename, download_url in download_urls.items(): - print "downloading", filename + print("downloading {0}".format(filename)) download_file(filename, download_url) upload_file(filename) diff --git a/contrib/dokku-installer.py b/contrib/dokku-installer.py index 741ce51d3..20765781c 100755 --- a/contrib/dokku-installer.py +++ b/contrib/dokku-installer.py @@ -1,11 +1,15 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python import cgi import json import os import re -import SimpleHTTPServer -import SocketServer +try: + import SimpleHTTPServer + import SocketServer +except ImportError: + import http.server as SimpleHTTPServer + import socketserver as SocketServer import subprocess import sys import threading @@ -232,7 +236,7 @@ def main(): port = int(os.getenv('PORT', 2000)) httpd = SocketServer.TCPServer(("", port), GetHandler) - print "Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port) + print("Listening on 0.0.0.0:{0}, CTRL+C to stop".format(port)) httpd.serve_forever() diff --git a/debian/control b/debian/control index e883b4f8d..7686d27e8 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,9 @@ Version: 0.18.3 Section: web Priority: optional Architecture: amd64 -Depends: locales, git, curl, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.13.0) | docker-engine (>= 1.13.0) | docker-io (>= 1.13.0) | docker.io (>= 1.13.0) | docker-ce (>= 1.13.0) | docker-ee (>= 1.13.0), net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix +Depends: locales, git, curl, man-db, netcat, sshcommand (>= 0.6.0), gliderlabs-sigil, docker-engine-cs (>= 1.13.0) | docker-engine (>= 1.13.0) | docker-io (>= 1.13.0) | docker.io (>= 1.13.0) | docker-ce (>= 1.13.0) | docker-ee (>= 1.13.0), net-tools, software-properties-common, procfile-util, python-software-properties | python3-software-properties, rsyslog, dos2unix, jq Recommends: herokuish (>= 0.3.4), parallel, dokku-update -Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python2.7, debconf +Pre-Depends: nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python | python2.7 | python3, debconf Maintainer: Jose Diaz-Gonzalez Description: Docker-powered PaaS that helps build and manage the lifecycle of applications Dokku is an extensible, open source Platform as a Service diff --git a/debian/lintian-overrides b/debian/lintian-overrides index b659deeeb..31e14eb7e 100644 --- a/debian/lintian-overrides +++ b/debian/lintian-overrides @@ -10,3 +10,6 @@ dokku: hardening-no-relro # Built golang binaries link to libc dokku: missing-dependency-on-libc + +# Temporary python dependency until #2247 is resolved +dokku: python-script-but-no-python-dep usr/share/dokku/contrib/dokku-installer.py diff --git a/plugins/app-json/internal-functions b/plugins/app-json/internal-functions index b5adb2c6c..cdb8ff68c 100755 --- a/plugins/app-json/internal-functions +++ b/plugins/app-json/internal-functions @@ -17,7 +17,7 @@ get_phase_script() { return 0 fi - get_json_value "scripts.dokku.${PHASE_SCRIPT_KEY}" <"$APP_JSON_FILE" + get_json_value ".scripts.dokku.${PHASE_SCRIPT_KEY}" <"$APP_JSON_FILE" } get_release_cmd() { diff --git a/plugins/common/functions b/plugins/common/functions index b3aee81bd..65daac823 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -923,24 +923,10 @@ internal_get_app_urls() { get_json_value() { declare desc="return value of provided json key from a json stream on stdin" # JSON_NODE should be expresses as either a top-level object that has no children - # or in the format of json.node.path + # or in the format of .json.node.path local JSON_NODE="$1" - local JSON_NODE=${JSON_NODE//\./\"][\"} - local JSON_NODE="[\"${JSON_NODE}\"]" - cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print json.dumps(obj'"${JSON_NODE}"').strip("\"")' -} -get_json_keys() { - declare desc="return space-separated list of json keys from json provided on stdin" - # JSON_NODE should be expressed as json.node.path and is expected to have children - local JSON_NODE="$1" - local JSON_NODE=${JSON_NODE//\./\"][\"} - local JSON_NODE="[\"${JSON_NODE}\"]" - if [[ "$JSON_NODE" == "[\"\"]" ]]; then - cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj.keys())' - else - cat | python2.7 -c 'import json,sys;obj=json.load(sys.stdin);print " ".join(obj'"${JSON_NODE}"'.keys())' - fi + cat | jq -r "${JSON_NODE} | select (.!=null)" 2>/dev/null } strip_inline_comments() { diff --git a/plugins/scheduler-docker-local/scheduler-inspect b/plugins/scheduler-docker-local/scheduler-inspect index 19708c3f5..c6ef49d06 100755 --- a/plugins/scheduler-docker-local/scheduler-inspect +++ b/plugins/scheduler-docker-local/scheduler-inspect @@ -40,7 +40,7 @@ for container in data: container['Config']['Env'] = env output.append(container) -print json.dumps(data, sort_keys=True, indent=4) +print(json.dumps(data, sort_keys=True, indent=4)) EOF local CONTAINER_FILES="$(find "$DOKKU_ROOT/$APP" -maxdepth 1 -name "CONTAINER.*" -printf "%f\n" 2>/dev/null | sort -t . -k 2 -n | xargs)" diff --git a/rpm.mk b/rpm.mk index ccc0ca9af..fb5cdbe86 100644 --- a/rpm.mk +++ b/rpm.mk @@ -65,6 +65,7 @@ endif --depends 'dos2unix' \ --depends 'git' \ --depends 'gliderlabs-sigil' \ + --depends 'jq' \ --depends 'man-db' \ --depends 'nc' \ --depends 'nginx >= 1.8.0' \ diff --git a/tests/ci/setup.sh b/tests/ci/setup.sh index 01951d58d..eb888f58c 100755 --- a/tests/ci/setup.sh +++ b/tests/ci/setup.sh @@ -29,7 +29,7 @@ install_dependencies() { sudo add-apt-repository -y ppa:nginx/stable sudo apt-get update - sudo apt-get -qq -y install cgroupfs-mount dos2unix nginx + sudo apt-get -qq -y install cgroupfs-mount dos2unix jq nginx sudo cp "${ROOT_DIR}/tests/dhparam.pem" /etc/nginx/dhparam.pem sudo dpkg -i "${ROOT_DIR}/build/$HEROKUISH_PACKAGE_NAME" \