[PKG-Openstack-devel] Bug#880597: python-oslo.concurrency: Align with Ubuntu

Corey Bryant corey.bryant at canonical.com
Thu Nov 2 17:40:14 UTC 2017


Package: python-oslo.concurrency
Version: 3.21.0-2
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch

Dear Maintainer,


In Ubuntu, the attached patch was applied to achieve the following:

    - d/rules: Run all tests.
    - d/control: Retain Breaks/Replaces.
    - d/gbp.conf: Retain git-buildpackage config, including use of pristine-tar.
    - d/p/lock-path-tempfile.patch: Cherry picked from upstream to set default
      of lock_file to a tempfile if OSLO_LOCK_PATH isn't set (LP: #1550188).
    - d/p/fix-tests-i386.patch: Fix tests that fail on i386 builds.
    - d/watch: Use tarballs.openstack.org.


Thanks for considering the patch.


-- System Information:
Debian Release: stretch/sid
  APT prefers bionic
  APT policy: (500, 'bionic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.13.0-16-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)
-------------- next part --------------
diff -Nru python-oslo.concurrency-3.21.0/debian/control python-oslo.concurrency-3.21.0/debian/control
--- python-oslo.concurrency-3.21.0/debian/control	2017-11-01 17:10:59.000000000 -0400
+++ python-oslo.concurrency-3.21.0/debian/control	2017-11-02 10:19:29.000000000 -0400
@@ -62,6 +62,8 @@
  python-six,
  ${misc:Depends},
  ${python:Depends},
+Breaks: python-oslo-concurrency (<< 1.10.0-1~),
+Replaces: python-oslo-concurrency (<< 1.10.0-1~),
 Suggests:
  python-oslo.concurrency-doc,
 Description: concurrency and locks for OpenStack projects - Python 2.x
@@ -95,6 +97,8 @@
  python3-six,
  ${misc:Depends},
  ${python3:Depends},
+Breaks: python3-oslo-concurrency (<< 1.10.0-1~),
+Replaces: python3-oslo-concurrency (<< 1.10.0-1~),
 Suggests:
  python-oslo.concurrency-doc,
 Description: oslo.concurrency library - Python 3.x
diff -Nru python-oslo.concurrency-3.21.0/debian/gbp.conf python-oslo.concurrency-3.21.0/debian/gbp.conf
--- python-oslo.concurrency-3.21.0/debian/gbp.conf	1969-12-31 19:00:00.000000000 -0500
+++ python-oslo.concurrency-3.21.0/debian/gbp.conf	2017-11-02 10:19:29.000000000 -0400
@@ -0,0 +1,7 @@
+[DEFAULT]
+debian-branch = master
+upstream-tag = %(version)s
+pristine-tar = True
+
+[buildpackage]
+export-dir = ../build-area
diff -Nru python-oslo.concurrency-3.21.0/debian/patches/fix-tests-i386.patch python-oslo.concurrency-3.21.0/debian/patches/fix-tests-i386.patch
--- python-oslo.concurrency-3.21.0/debian/patches/fix-tests-i386.patch	1969-12-31 19:00:00.000000000 -0500
+++ python-oslo.concurrency-3.21.0/debian/patches/fix-tests-i386.patch	2017-11-02 10:19:29.000000000 -0400
@@ -0,0 +1,18 @@
+Description: Strip long integer suffix from strings. A proper fix would be
+             more involved so I've opened a bug upstream.
+Bug: https://bugs.launchpad.net/bugs/1552690
+Author: Corey Bryant <corey.bryant at canonical.com>
+Forwarded: no
+
+--- a/oslo_concurrency/tests/unit/test_processutils.py
++++ b/oslo_concurrency/tests/unit/test_processutils.py
+@@ -795,7 +795,8 @@
+         args = [sys.executable, '-c', code]
+         stdout, stderr = processutils.execute(*args, prlimit=prlimit)
+         expected = (value, value)
+-        self.assertEqual(str(expected), stdout.rstrip())
++        self.assertEqual(str(expected).replace('L',''),
++                         stdout.rstrip().replace('L',''))
+ 
+     def test_address_space(self):
+         prlimit = self.limit_address_space()
diff -Nru python-oslo.concurrency-3.21.0/debian/patches/lock-path-tempfile.patch python-oslo.concurrency-3.21.0/debian/patches/lock-path-tempfile.patch
--- python-oslo.concurrency-3.21.0/debian/patches/lock-path-tempfile.patch	1969-12-31 19:00:00.000000000 -0500
+++ python-oslo.concurrency-3.21.0/debian/patches/lock-path-tempfile.patch	2017-11-02 10:19:29.000000000 -0400
@@ -0,0 +1,57 @@
+From 5021ef82fd8f0323b82d6d010bff9dab8a0cbcec Mon Sep 17 00:00:00 2001
+From: "Sean M. Collins" <sean at coreitpro.com>
+Date: Wed, 24 Feb 2016 16:25:52 -0500
+Subject: [PATCH] Use tempfile.tempdir for lock_path if OSLO_LOCK_PATH is not
+ set
+
+DevStack spends a lot of time setting lock_path in a bunch of
+locations.
+
+http://codesearch.openstack.org/?q=oslo_concurrency%20lock_path&i=nope&files=&repos=
+
+The default for lock_path is an environment variable
+OSLO_LOCK_PATH.
+
+http://codesearch.openstack.org/?q=OSLO_LOCK_PATH&i=nope&files=&repos=
+
+Since the default is to consult an environment variable, which may not
+even be set, this means that really there is no default. If you do
+not set it - you end up getting errors like:
+
+http://paste.openstack.org/show/488108/
+
+Ideally - a library should have a reasonable default, where if a user
+doesn't set something, the default will at least work. So, let's use
+Python's built in tempfile module, which has fairly complex rules for
+determining a sane directory to place temporary items in.
+
+https://docs.python.org/2/library/tempfile.html#tempfile.tempdir
+
+Change-Id: I6906af43bc0255cd215f2d9584ea000c81f5880e
+---
+ oslo_concurrency/lockutils.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py
+index 2e61ff3..227af59 100644
+--- a/oslo_concurrency/lockutils.py
++++ b/oslo_concurrency/lockutils.py
+@@ -41,11 +41,14 @@ _opts = [
+                 help='Enables or disables inter-process locks.',
+                 deprecated_group='DEFAULT'),
+     cfg.StrOpt('lock_path',
+-               default=os.environ.get("OSLO_LOCK_PATH"),
++               default=os.environ.get("OSLO_LOCK_PATH", tempfile.gettempdir()),
+                help='Directory to use for lock files.  For security, the '
+                     'specified directory should only be writable by the user '
+                     'running the processes that need locking. '
+                     'Defaults to environment variable OSLO_LOCK_PATH. '
++                    'If OSLO_LOCK_PATH is not set in the environment, use the '
++                    'Python tempfile.gettempdir function to find a suitable '
++                    'location. '
+                     'If external locks are used, a lock path must be set.',
+                deprecated_group='DEFAULT')
+ ]
+-- 
+2.7.0
+
diff -Nru python-oslo.concurrency-3.21.0/debian/patches/series python-oslo.concurrency-3.21.0/debian/patches/series
--- python-oslo.concurrency-3.21.0/debian/patches/series	1969-12-31 19:00:00.000000000 -0500
+++ python-oslo.concurrency-3.21.0/debian/patches/series	2017-11-02 10:19:29.000000000 -0400
@@ -0,0 +1,2 @@
+lock-path-tempfile.patch
+fix-tests-i386.patch
diff -Nru python-oslo.concurrency-3.21.0/debian/rules python-oslo.concurrency-3.21.0/debian/rules
--- python-oslo.concurrency-3.21.0/debian/rules	2017-11-01 17:10:59.000000000 -0400
+++ python-oslo.concurrency-3.21.0/debian/rules	2017-11-02 10:19:29.000000000 -0400
@@ -14,7 +14,7 @@
 
 override_dh_auto_test:
 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
-	pkgos-dh_auto_test 'oslo_concurrency\.tests\.unit(?!(.*test_processutils\.PrlimitTestCase\.test_address_space.*|.*test_processutils\.PrlimitTestCase\.test_core_size.*|.*test_processutils\.PrlimitTestCase\.test_cpu_time.*|.*test_processutils\.PrlimitTestCase\.test_data_size.*|.*test_processutils\.PrlimitTestCase\.test_file_size.*|.*test_processutils\.PrlimitTestCase\.test_resident_set_size.*))'
+	pkgos-dh_auto_test
 endif
 
 override_dh_clean:
diff -Nru python-oslo.concurrency-3.21.0/debian/watch python-oslo.concurrency-3.21.0/debian/watch
--- python-oslo.concurrency-3.21.0/debian/watch	2017-11-01 17:10:59.000000000 -0400
+++ python-oslo.concurrency-3.21.0/debian/watch	2017-11-02 10:19:29.000000000 -0400
@@ -1,3 +1,3 @@
 version=3
-opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
-https://pypi.debian.net/oslo.concurrency/oslo.concurrency-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
+opts="uversionmangle=s/\.(b|rc)/~$1/" \
+    http://tarballs.openstack.org/oslo.concurrency/ oslo.concurrency-(\d.*)\.tar\.gz


More information about the Openstack-devel mailing list