diff -Nru gnocchi-4.2.4/debian/changelog gnocchi-4.2.4/debian/changelog --- gnocchi-4.2.4/debian/changelog 2018-05-02 19:11:13.000000000 +0000 +++ gnocchi-4.2.4/debian/changelog 2018-06-07 17:22:19.000000000 +0000 @@ -1,3 +1,20 @@ +gnocchi (4.2.4-0ubuntu3) cosmic; urgency=medium + + * Enable alternative python2 dependencies for gnocchi-api (LP: #1746992): + - d/control: gnocchi-api depends on libapache2-mod-wsgi-py3 by default and + libapache2-mod-wsgi as an alternative. gnocchi-api also depends on + gnocchi-common, which depends on python3-gnocchi by default and + python-gnocchi as an alternative. + - d/control: move all other python run-time dependencies to + python(3)-gnocchi packages. + - d/control: Add Conflicts to python(3)-gnocchi binary to ensure both + can't be installed at the same time. + - d/control, d/tests/*: Enable autopkgtest-pkg-python testsuite and drop + obsolete XS-Testsuite: autopkgtest header. + - d/tests/*: Add Python 2/3 autopkgtests for gnocchi daemons and shebangs. + + -- Corey Bryant Thu, 07 Jun 2018 13:22:19 -0400 + gnocchi (4.2.4-0ubuntu2) cosmic; urgency=medium * New stable point release for OpenStack Queens (LP: #1767128). diff -Nru gnocchi-4.2.4/debian/control gnocchi-4.2.4/debian/control --- gnocchi-4.2.4/debian/control 2018-05-02 19:11:13.000000000 +0000 +++ gnocchi-4.2.4/debian/control 2018-06-07 17:22:19.000000000 +0000 @@ -130,16 +130,14 @@ Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/gnocchi Vcs-Git: git://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/gnocchi Homepage: https://github.com/openstack/gnocchi -XS-Testsuite: autopkgtest +Testsuite: autopkgtest-pkg-python Package: gnocchi-api Architecture: all Depends: apache2 | httpd, gnocchi-common (= ${binary:Version}), - libapache2-mod-wsgi-py3, - python3-gnocchi (= ${binary:Version}), - python3-openstackclient, + libapache2-mod-wsgi-py3 | libapache2-mod-wsgi, q-text-as-data, ${misc:Depends}, Description: Metric as a Service - API daemon @@ -202,6 +200,7 @@ python-lz4, python-msgpack, python-numpy, + python-openstackclient, python-oslo.config (>= 1:3.22.0), python-oslo.db (>= 4.8.0), python-oslo.log (>= 2.3.0), @@ -245,6 +244,8 @@ gnocchi-common (<< 4.1.0-0ubuntu1~), gnocchi-metricd (<< 4.1.0-0ubuntu1~), gnocchi-statsd (<< 4.1.0-0ubuntu1~), +Conflicts: + python3-gnocchi, Description: Metric as a Service - Python 2.x Gnocchi is a service for managing a set of resources and storing metrics about them, in a scalable and resilient way. Its functionalities are exposed over an @@ -265,6 +266,7 @@ python3-lz4, python3-msgpack, python3-numpy, + python3-openstackclient, python3-oslo.config (>= 1:3.22.0), python3-oslo.db (>= 4.8.0), python3-oslo.log (>= 2.3.0), @@ -310,6 +312,8 @@ gnocchi-metricd (<< 4.1.0-0ubuntu1~), gnocchi-statsd (<< 4.1.0-0ubuntu1~), python-gnocchi (<< 4.1.0-0ubuntu1~), +Conflicts: + python-gnocchi, Description: Metric as a Service - Python 3.x Gnocchi is a service for managing a set of resources and storing metrics about them, in a scalable and resilient way. Its functionalities are exposed over an diff -Nru gnocchi-4.2.4/debian/tests/control gnocchi-4.2.4/debian/tests/control --- gnocchi-4.2.4/debian/tests/control 2018-05-02 19:11:13.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/control 2018-06-07 17:22:19.000000000 +0000 @@ -1,3 +1,10 @@ -Tests: gnocchi-daemons python-gnocchi -Depends: @, crudini, mysql-server, uuid-runtime, memcached +Tests: gnocchi-daemons, gnocchi-shebangs-py2 +Depends: libapache2-mod-wsgi, python-gnocchi, + gnocchi-api, gnocchi-metricd, gnocchi-statsd, + crudini, mysql-server, uuid-runtime, memcached +Restrictions: needs-root, allow-stderr + +Tests: gnocchi-daemons, gnocchi-shebangs-py3 +Depends: gnocchi-api, gnocchi-metricd, gnocchi-statsd, + crudini, mysql-server, uuid-runtime, memcached Restrictions: needs-root, allow-stderr diff -Nru gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py2 gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py2 --- gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py2 1970-01-01 00:00:00.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py2 2018-06-07 17:22:19.000000000 +0000 @@ -0,0 +1,18 @@ +#!/bin/bash +#--------------------- +# Testing /usr/bin/gnocchi-* shebangs +#--------------------- +set -e + +BINARIES=('gnocchi-api' 'gnocchi-change-sack-size' 'gnocchi-config-generator' \ + 'gnocchi-metricd' 'gnocchi-statsd' 'gnocchi-upgrade') + +ret=0 + +for binary in "${BINARIES[@]}"; do + if ! `dirname $0`/test-shebang.py $binary python2; then + ret=1 + fi +done + +exit $ret diff -Nru gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py3 gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py3 --- gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py3 1970-01-01 00:00:00.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/gnocchi-shebangs-py3 2018-06-07 17:22:19.000000000 +0000 @@ -0,0 +1,18 @@ +#!/bin/bash +#--------------------- +# Testing /usr/bin/gnocchi-* shebangs +#--------------------- +set -e + +BINARIES=('gnocchi-api' 'gnocchi-change-sack-size' 'gnocchi-config-generator' \ + 'gnocchi-metricd' 'gnocchi-statsd' 'gnocchi-upgrade') + +ret=0 + +for binary in "${BINARIES[@]}"; do + if ! `dirname $0`/test-shebang.py $binary python3; then + ret=1 + fi +done + +exit $ret diff -Nru gnocchi-4.2.4/debian/tests/python-gnocchi gnocchi-4.2.4/debian/tests/python-gnocchi --- gnocchi-4.2.4/debian/tests/python-gnocchi 2018-05-02 19:11:13.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/python-gnocchi 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!/bin/bash -#------------------------- -# Testing client utilities -#------------------------- -set -e - -result=$(python3 `dirname $0`/test_import_gnocchi.py 2>&1) -if [ "$result" ]; then - echo "ERROR: PYTHON-GNOCCHI MODULE CANNOT BE IMPORTED" - exit 1 -else - echo "OK" - exit 0 -fi - diff -Nru gnocchi-4.2.4/debian/tests/test_import_gnocchi.py gnocchi-4.2.4/debian/tests/test_import_gnocchi.py --- gnocchi-4.2.4/debian/tests/test_import_gnocchi.py 2018-05-02 19:11:13.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/test_import_gnocchi.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -try: - import gnocchi -except ImportError as e: - print("ERROR IMPORTING MODULE") diff -Nru gnocchi-4.2.4/debian/tests/test-shebang.py gnocchi-4.2.4/debian/tests/test-shebang.py --- gnocchi-4.2.4/debian/tests/test-shebang.py 1970-01-01 00:00:00.000000000 +0000 +++ gnocchi-4.2.4/debian/tests/test-shebang.py 2018-06-07 17:22:19.000000000 +0000 @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +""" +Test Python shebang in /usr/bin/ binary +""" +import sys + +ret = 0 +bin_path = "/usr/bin/{}".format(sys.argv[1]) +shebang = "#!/usr/bin/{}".format(sys.argv[2]) + +with open(bin_path) as f: + first_line = f.readline().rstrip().replace(" ", "") + if first_line != shebang: + print("ERROR: shebang '{}' not found in {}".format(shebang, bin_path)) + ret = 1 + else: + print("OK") + +sys.exit(ret)