rebase python-oslo-service patch to CentOS7.5

Story: 2003389
Task: 24473
Depends-On: https://review.openstack.org/596702

Change-Id: Id48774107bf9e9d23db0fe677b6f91218e5adb0b
Signed-off-by: slin14 <shuicheng.lin@intel.com>
This commit is contained in:
slin14 2018-08-28 04:41:10 +08:00
parent 4e2f2c17eb
commit b00011f00f
4 changed files with 29 additions and 39 deletions

View File

@ -1,21 +1,20 @@
From 0005b00e62641792f7cb5a647c4720601f4081db Mon Sep 17 00:00:00 2001
From e6daf4d7dbe603e82a267d6d99a454453b902f68 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:42:44 -0400
Subject: [PATCH 2/2] WRS:
spec-loopingcall-permit-aborting-while-sleeping.patch
Subject: [PATCH] WRS: spec-loopingcall-permit-aborting-while-sleeping.patch
---
SPECS/python-oslo-service.spec | 6 ++++++
1 file changed, 6 insertions(+)
SPECS/python-oslo-service.spec | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/SPECS/python-oslo-service.spec b/SPECS/python-oslo-service.spec
index ebf5ccf..7d138d0 100644
index 658bb42..5ff8f34 100644
--- a/SPECS/python-oslo-service.spec
+++ b/SPECS/python-oslo-service.spec
@@ -14,6 +14,10 @@ Summary: Oslo service library
License: ASL 2.0
URL: http://launchpad.net/oslo
Source0: https://pypi.io/packages/source/o/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{upstream_version}.tar.gz
+
+# WRS
+Patch0001: loopingcall-permit-aborting-while-sleeping.patch
@ -23,15 +22,6 @@ index ebf5ccf..7d138d0 100644
BuildArch: noarch
%package -n python2-%{pname}
@@ -131,6 +135,8 @@ Library for running OpenStack services
%prep
%setup -q -n %{pypi_name}-%{upstream_version}
+# Apply WRS patches
+%patch0001 -p1
%build
%py2_build
--
1.9.1
2.7.4

View File

@ -1,4 +1,4 @@
From e38fcd3820d8c48d23d3b17a20d78d600c8e0347 Mon Sep 17 00:00:00 2001
From 7081d0aaaf782a19251d9e43b543c99c93ab218d Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 14:42:44 -0400
Subject: [PATCH 1/2] WRS: update-package-versioning-for-tis-format.patch
@ -10,18 +10,18 @@ Conflicts:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/python-oslo-service.spec b/SPECS/python-oslo-service.spec
index 172e484..ebf5ccf 100644
index d95f88e..658bb42 100644
--- a/SPECS/python-oslo-service.spec
+++ b/SPECS/python-oslo-service.spec
@@ -8,7 +8,7 @@
Name: python-%{pname}
Version: 1.16.1
Version: 1.25.1
-Release: 1%{?dist}
+Release: 1.el7%{?_tis_dist}.%{tis_patch_ver}
Summary: Oslo service library
License: ASL 2.0
--
1.9.1
2.7.4

View File

@ -1,4 +1,4 @@
From 4e07594552a7249c45bf12fb66c79faedace1721 Mon Sep 17 00:00:00 2001
From a4de48a129ff6526ae19533af76730c4707d8a53 Mon Sep 17 00:00:00 2001
From: Allain Legacy <allain.legacy@windriver.com>
Date: Wed, 31 May 2017 16:18:19 -0400
Subject: [PATCH] Permit aborting loopingcall while sleeping
@ -37,18 +37,18 @@ Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/oslo_service/loopingcall.py b/oslo_service/loopingcall.py
index 72eaab1..d1c12fd 100644
index 1747fda..ee2813d 100644
--- a/oslo_service/loopingcall.py
+++ b/oslo_service/loopingcall.py
@@ -17,6 +17,7 @@
@@ -18,6 +18,7 @@
import random
import sys
import time
+import threading
from eventlet import event
from eventlet import greenthread
@@ -84,19 +85,25 @@ class LoopingCallBase(object):
@@ -85,19 +86,25 @@ class LoopingCallBase(object):
self.args = args
self.kw = kw
self.f = f
@ -77,7 +77,7 @@ index 72eaab1..d1c12fd 100644
def _start(self, idle_for, initial_delay=None, stop_on_exception=True):
"""Start the looping
@@ -113,8 +120,8 @@ class LoopingCallBase(object):
@@ -114,8 +121,8 @@ class LoopingCallBase(object):
"""
if self._thread is not None:
raise RuntimeError(self._RUN_ONLY_ONE_MESSAGE)
@ -87,7 +87,7 @@ index 72eaab1..d1c12fd 100644
self._thread = greenthread.spawn(
self._run_loop, idle_for,
initial_delay=initial_delay, stop_on_exception=stop_on_exception)
@@ -128,7 +135,7 @@ class LoopingCallBase(object):
@@ -129,7 +136,7 @@ class LoopingCallBase(object):
func = self.f if stop_on_exception else _safe_wrapper(self.f, kind,
func_name)
if initial_delay:
@ -96,7 +96,7 @@ index 72eaab1..d1c12fd 100644
try:
watch = timeutils.StopWatch()
while self._running:
@@ -142,7 +149,7 @@ class LoopingCallBase(object):
@@ -143,7 +150,7 @@ class LoopingCallBase(object):
'for %(idle).02f seconds',
{'func_name': func_name, 'idle': idle,
'kind': kind})
@ -106,10 +106,10 @@ index 72eaab1..d1c12fd 100644
self.done.send(e.retvalue)
except Exception:
diff --git a/oslo_service/tests/test_loopingcall.py b/oslo_service/tests/test_loopingcall.py
index c149506..b3c7842 100644
index 7ac8025..218e9d1 100644
--- a/oslo_service/tests/test_loopingcall.py
+++ b/oslo_service/tests/test_loopingcall.py
@@ -276,7 +276,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
@@ -285,7 +285,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
else:
self.num_runs = self.num_runs - 1
@ -118,7 +118,7 @@ index c149506..b3c7842 100644
def test_timeout_task_without_return(self, sleep_mock):
self.num_runs = 1
timer = loopingcall.DynamicLoopingCall(
@@ -285,7 +285,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
@@ -294,7 +294,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
timer.start(periodic_interval_max=5).wait()
sleep_mock.assert_has_calls([mock.call(5)])
@ -127,7 +127,7 @@ index c149506..b3c7842 100644
def test_interval_adjustment(self, sleep_mock):
self.num_runs = 2
@@ -294,7 +294,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
@@ -303,7 +303,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
sleep_mock.assert_has_calls([mock.call(5), mock.call(1)])
@ -136,7 +136,7 @@ index c149506..b3c7842 100644
def test_initial_delay(self, sleep_mock):
self.num_runs = 1
@@ -306,7 +306,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
@@ -315,7 +315,7 @@ class DynamicLoopingCallTestCase(test_base.BaseTestCase):
class TestBackOffLoopingCall(test_base.BaseTestCase):
@mock.patch('random.SystemRandom.gauss')
@ -145,7 +145,7 @@ index c149506..b3c7842 100644
def test_exponential_backoff(self, sleep_mock, random_mock):
def false():
return False
@@ -330,7 +330,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
@@ -366,7 +366,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
self.assertEqual(expected_times, sleep_mock.call_args_list)
@mock.patch('random.SystemRandom.gauss')
@ -154,7 +154,7 @@ index c149506..b3c7842 100644
def test_no_backoff(self, sleep_mock, random_mock):
random_mock.return_value = 1
func = mock.Mock()
@@ -345,7 +345,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
@@ -381,7 +381,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
self.assertTrue(retvalue, 'return value')
@mock.patch('random.SystemRandom.gauss')
@ -163,7 +163,7 @@ index c149506..b3c7842 100644
def test_no_sleep(self, sleep_mock, random_mock):
# Any call that executes properly the first time shouldn't sleep
random_mock.return_value = 1
@@ -358,7 +358,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
@@ -394,7 +394,7 @@ class TestBackOffLoopingCall(test_base.BaseTestCase):
self.assertTrue(retvalue, 'return value')
@mock.patch('random.SystemRandom.gauss')
@ -173,5 +173,5 @@ index c149506..b3c7842 100644
def false():
return False
--
2.12.1
2.7.4

View File

@ -1 +1 @@
mirror:Source/python-oslo-service-1.16.1-1.el7.src.rpm
mirror:Source/python-oslo-service-1.25.1-1.el7.src.rpm