Package: openstack-trove Version: 1:9.0.0-1 Severity: normal Tags: patch User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu cosmic ubuntu-patch
Dear Maintainer, Multiple calls to pkgos_rabbit_write_conf cause the trove-common.postinst script to fail: https://paste.ubuntu.com/p/BT4n6GXy3p/ Additionally, in Ubuntu, the attached patch was applied to achieve the following: * d/rules: Align test execution with upstream, including ostestr --serial. * d/p/fix-usage-of-gettext.install: Fix gettext.install() calls for py3.x. Thanks for considering the patch. -- System Information: Debian Release: buster/sid APT prefers cosmic APT policy: (500, 'cosmic'), (500, 'bionic-security') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.15.0-23-generic (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru openstack-trove-9.0.0/debian/patches/fix-usage-of-gettext.install openstack-trove-9.0.0/debian/patches/fix-usage-of-gettext.install --- openstack-trove-9.0.0/debian/patches/fix-usage-of-gettext.install 1969-12-31 19:00:00.000000000 -0500 +++ openstack-trove-9.0.0/debian/patches/fix-usage-of-gettext.install 2018-06-21 11:54:58.000000000 -0400 @@ -0,0 +1,112 @@ +From 08d581fd5c4dcd91cf5999fa270d32e6fe6edf43 Mon Sep 17 00:00:00 2001 +From: Corey Bryant <corey.bry...@canonical.com> +Date: Mon, 18 Jun 2018 09:10:57 -0400 +Subject: [PATCH] py3.x: Fix usage of gettext.install + +This needed to be updated to get py3.x to work. + +Change-Id: I987854c0266566e1e7722478dbb3e27bcffbb08b +Closes-Bug: #1777440 +--- + integration/tests/integration/int_tests.py | 6 +++++- + integration/tests/integration/tests/colorizer.py | 6 +++++- + trove/cmd/common.py | 4 ---- + trove/cmd/guest.py | 3 --- + trove/cmd/manage.py | 5 ----- + 5 files changed, 10 insertions(+), 14 deletions(-) + +diff --git a/integration/tests/integration/int_tests.py b/integration/tests/integration/int_tests.py +index b139820a..1e73a224 100644 +--- a/integration/tests/integration/int_tests.py ++++ b/integration/tests/integration/int_tests.py +@@ -45,6 +45,7 @@ import logging + import os + import time + import unittest ++import six + import sys + import proboscis + +@@ -73,7 +74,10 @@ def add_support_for_localization(): + if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): + sys.path.insert(0, possible_topdir) + +- gettext.install('nova', unicode=1) ++ if six.PY2: ++ gettext.install('nova', unicode=1) ++ else: ++ gettext.install('nova') + + + MAIN_RUNNER = None +diff --git a/integration/tests/integration/tests/colorizer.py b/integration/tests/integration/tests/colorizer.py +index 31cdb201..7defd0c2 100644 +--- a/integration/tests/integration/tests/colorizer.py ++++ b/integration/tests/integration/tests/colorizer.py +@@ -59,10 +59,14 @@ import heapq + import logging + import os + import unittest ++import six + import sys + import time + +-gettext.install('nova', unicode=1) ++if six.PY2: ++ gettext.install('nova', unicode=1) ++else: ++ gettext.install('nova') + + from nose import config + from nose import core +diff --git a/trove/cmd/common.py b/trove/cmd/common.py +index 1e756e81..1267ed9f 100644 +--- a/trove/cmd/common.py ++++ b/trove/cmd/common.py +@@ -15,10 +15,6 @@ + + + def initialize(extra_opts=None, pre_logging=None): +- # Initialize localization support (the underscore character). +- import gettext +- gettext.install('trove', unicode=1) +- + # Import only the modules necessary to initialize logging and determine if + # debug_utils are enabled. + import sys +diff --git a/trove/cmd/guest.py b/trove/cmd/guest.py +index 687cebe2..d4f90b83 100644 +--- a/trove/cmd/guest.py ++++ b/trove/cmd/guest.py +@@ -13,9 +13,6 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import gettext +-gettext.install('trove', unicode=1) +- + import sys + + from oslo_config import cfg as openstack_cfg +diff --git a/trove/cmd/manage.py b/trove/cmd/manage.py +index 76500d31..dc44d0f5 100644 +--- a/trove/cmd/manage.py ++++ b/trove/cmd/manage.py +@@ -13,14 +13,9 @@ + # License for the specific language governing permissions and limitations + # under the License. + +-import gettext + import inspect + import sys + +- +-gettext.install('trove', unicode=1) +- +- + from oslo_log import log as logging + + from trove.common import cfg +-- +2.17.1 + diff -Nru openstack-trove-9.0.0/debian/patches/series openstack-trove-9.0.0/debian/patches/series --- openstack-trove-9.0.0/debian/patches/series 2018-02-19 06:13:48.000000000 -0500 +++ openstack-trove-9.0.0/debian/patches/series 2018-06-21 11:54:58.000000000 -0400 @@ -10,3 +10,4 @@ #py3-fix.patch #py3-fix-map-object-returns-iterator-not-list.patch Fix_guestagent.test_operating_system_for_Python3.patch +fix-usage-of-gettext.install diff -Nru openstack-trove-9.0.0/debian/rules openstack-trove-9.0.0/debian/rules --- openstack-trove-9.0.0/debian/rules 2018-02-19 06:13:48.000000000 -0500 +++ openstack-trove-9.0.0/debian/rules 2018-06-21 11:54:51.000000000 -0400 @@ -39,9 +39,11 @@ python$$pyvers setup.py install --install-layout=deb --root $(CURDIR)/debian/tmp; \ done ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) - pkgos-dh_auto_test --no-py2 'trove\.tests\.unittests\.(?!(.*backup\.test_backup_models\.BackupCreateTest\.test_create_backup_cluster_instance_operation_not_supported.*|.*backup\.test_backup_models\.BackupCreateTest\.test_create_instance_not_active.*|.*backup\.test_backup_models\.BackupCreateTest\.test_create_instance_not_found.*|.*mgmt\.test_datastores\.TestDatastoreVersion\.test_version_create.*|.*guestagent\.test_redis_manager\.RedisGuestAgentManagerTest.*|.*guestagent\.test_backups\.MongodbRestoreTests\.test_restore_failed_due_to_pre_restore.*|.*guestagent\.test_backups\.MongodbRestoreTests\.test_restore_failed_due_to_run_restore.*|.*guestagent\.test_backups\.MongodbRestoreTests\.test_restore_success.*|.*backup\.test_backup_models\.BackupCreateTest\.test_create.*|.*backup\.test_backup_models\.BackupDeleteTest\.test_delete.*))' + for i in 2 3; do \ + rm -f trove_test.sqlite; \ + python$$i-ostestr --serial; \ + done endif - dh_install -O--buildsystem=python_distutils --fail-missing # Install the config files in the different binary packages # -guestagent