Merge ~zioproto/ubuntu/+source/cinder:stable/liberty into ~ubuntu-server-dev/ubuntu/+source/cinder:stable/liberty

Proposed by Saverio Proto
Status: Merged
Merged at revision: d5da74baf84509ce8799b51c2906ca5d40edec59
Proposed branch: ~zioproto/ubuntu/+source/cinder:stable/liberty
Merge into: ~ubuntu-server-dev/ubuntu/+source/cinder:stable/liberty
Diff against target: 135 lines (+114/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/cinder-306610.patch (+106/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Corey Bryant Approve
Review via email: mp+304341@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Saverio Proto (zioproto) wrote :

I am building this package as follows:
sbuild-liberty -A -d trusty-amd64 ../build-area/cinder_7.0.2-0ubuntu2.dsc

The dsc file looks good.

I have no idea why in the final deb package, the 'Depends:' section of the package control file is broken. There are some packages that are mentioned with an extra dash (-), like for example 'python-novaclient-'. This makes the package impossible to install. I paste here the control file:

Package: python-cinder
Source: cinder
Version: 2:7.0.2-0ubuntu2
Architecture: all
Maintainer: Ubuntu Developers <email address hidden>
Installed-Size: 14524
Depends: python-anyjson (>= 0.3.3), python-babel (>= 1.3), python-barbicanclient (>= 3.3.0), python-crypto (>= 2.6), python-enum34, python-eventlet (>= 0.17.4), python-glanceclient (>= 1:0.18.0), python-greenlet (>= 0.3.2), python-iso8601 (>= 0.1.9), python-keystonemiddleware (>= 2.0.0), python-kombu (>= 3.0.7), python-lxml (>= 2.3), python-migrate (>= 0.9.6), python-netaddr (>= 0.7.12), python-novaclient (>= 1:2.28.1), python-os-brick (>= 0.4.0), python-oslo.concurrency (>= 2.3.0), python-oslo.config (>= 1:2.3.0), python-oslo.context (>= 0.2.0), python-oslo.db (>= 2.4.1), python-oslo.i18n (>= 1.5.0), python-oslo.log (>= 1.8.0), python-oslo.messaging (>= 1.16.0), python-oslo.middleware (>= 2.8.0), python-oslo.policy (>= 0.5.0), python-oslo.reports (>= 0.1.0), python-oslo.rootwrap (>= 2.0.0), python-oslo.serialization (>= 1.4.0), python-oslo.service (>= 0.7.0), python-oslo.utils (>= 2.0.0), python-oslo.versionedobjects (>= 0.9.0), python-oslo.vmware (>= 1.16.0), python-osprofiler (>= 0.3.0), python-paramiko (>= 1.13.0), python-paste, python-pastedeploy (>= 1.5.0), python-pbr (>= 1.8), python-pyparsing (>= 2.0.1), python-requests (>= 2.5.2), python-retrying (>= 1.2.3), python-routes (>= 1.12.3), python-six (>= 1.9.0), python-sqlalchemy (>= 1.0~), python-stevedore (>= 1.5.0), python-suds, python-swiftclient (>= 1:2.2.0), python-taskflow (>= 1.16.0), python-tz (>= 2013.6), python-webob (>= 1.2.3), python-retrying-, python:any (<< 2.8), python-oslo.middleware-, python-novaclient-, python-keystonemiddleware-, python-oslo.messaging-, python:any (>= 2.7.5-5~), python-netaddr-, python-oslo.utils-, python-requests-, python-sqlalchemy (<< 1.1), python-keystoneclient-
Suggests: python-ceph, python-hp3parclient, python-rtslib-fb
Section: python
Priority: extra
Homepage: http://launchpad.net/cinder
Description: Cinder Python libraries
 OpenStack is a reliable cloud infrastructure. Its mission is to produce
 the ubiquitous cloud computing platform that will meet the needs of public
 and private cloud providers regardless of size, by being simple to implement
 and massively scalable.
 .
 Cinder is the OpenStack Block storage service.
 .
 This package contains the Python library for Cinder.
Original-Maintainer: Chuck Short <email address hidden>

Revision history for this message
James Page (james-page) :
Revision history for this message
James Page (james-page) wrote :

Taking a look at your build failure now.

Revision history for this message
James Page (james-page) wrote :

Saverio

Could you confirm the version of cloud-archive-utils you are using - I think that the problem you are hitting is something that has been resolved in r48.

Revision history for this message
Saverio Proto (zioproto) wrote :

Here you go:

ubuntu@ubuntu-xenial:~/cleancinder/cinder$ apt-cache policy cloud-archive-utils
cloud-archive-utils:
  Installed: 0.1-0~50~ubuntu16.04.1
  Candidate: 0.1-0~50~ubuntu16.04.1
  Version table:
 *** 0.1-0~50~ubuntu16.04.1 500
        500 http://ppa.launchpad.net/ubuntu-cloud-archive/tools/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status

I am able to reproduce the build problem even without my patch, here the steps

debcheckout --git-track='*' cinder
cd cinder/
git checkout stable/liberty
gbp buildpackage -S -us -uc
sbuild-liberty -A -d trusty-amd64 ../build-area/cinder_7.0.2-0ubuntu1.dsc

the resulting python-cinder_7.0.2-0ubuntu1_all.deb will have the extra '-' in the control file

Revision history for this message
Corey Bryant (corey.bryant) wrote :

LGTM, thanks for the patch!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 4955d12..444c35b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1cinder (2:7.0.2-0ubuntu2) UNRELEASED; urgency=medium
2
3 * RBD: Delete snapshots if missing in the Ceph backend (LP: #1415905):
4 - d/p/cinder-306610.patch: Apply patch from review 306610.
5
6 -- Saverio Proto <saverio.proto@switch.ch> Mon, 29 Aug 2016 20:42:39 +0000
7
1cinder (2:7.0.2-0ubuntu1) wily; urgency=medium8cinder (2:7.0.2-0ubuntu1) wily; urgency=medium
29
3 * New upstream point release for OpenStack Liberty (LP: #1569502).10 * New upstream point release for OpenStack Liberty (LP: #1569502).
diff --git a/debian/patches/cinder-306610.patch b/debian/patches/cinder-306610.patch
4new file mode 10064411new file mode 100644
index 0000000..7db701a
--- /dev/null
+++ b/debian/patches/cinder-306610.patch
@@ -0,0 +1,106 @@
1commit 0d526b167fc75f61ef398140ff27c022489c15c8
2Author: Saverio Proto <saverio.proto@switch.ch>
3Date: Fri Apr 1 13:50:16 2016 +0200
4
5 RBD: delete snapshots if missing in the backend
6
7 snapshot delete should be more robust to also handle backend errors.
8 In case the backend does not have the image snapshot anymore,
9 log an info message and succeed the operation.
10 A first attempt to fix this problem was found on
11 https://review.openstack.org/#/c/151257/
12 This patch is already merged but it does not fix the problem
13 completely.
14
15 Closes-Bug: #1415905
16 (cherry picked from commit 677eb1c4160c08cfce2900495741f0ea15f566fa)
17
18 Change-Id: I51b0f5bb2bb60144dace79ebed06a66aaeb54574
19
20diff --git a/cinder/tests/unit/test_rbd.py b/cinder/tests/unit/test_rbd.py
21index 604fc7b..81695f1 100644
22--- a/cinder/tests/unit/test_rbd.py
23+++ b/cinder/tests/unit/test_rbd.py
24@@ -83,6 +83,7 @@ def common_mocks(f):
25 inst.mock_rbd.ImageBusy = MockImageBusyException
26 inst.mock_rbd.ImageNotFound = MockImageNotFoundException
27 inst.mock_rbd.ImageExists = MockImageExistsException
28+ inst.mock_rbd.InvalidArgument = MockImageNotFoundException
29
30 inst.driver.rbd = inst.mock_rbd
31 inst.driver.rados = inst.mock_rados
32@@ -402,6 +403,42 @@ class RBDTestCase(test.TestCase):
33 self.assertFalse(proxy.remove_snap.called)
34
35 @common_mocks
36+ def test_delete_notfound_snapshot(self):
37+ proxy = self.mock_proxy.return_value
38+ proxy.__enter__.return_value = proxy
39+
40+ proxy.unprotect_snap.side_effect = (
41+ self.mock_rbd.ImageNotFound)
42+
43+ self.driver.delete_snapshot(self.snapshot)
44+
45+ proxy.remove_snap.assert_called_with(self.snapshot_name)
46+ proxy.unprotect_snap.assert_called_with(self.snapshot_name)
47+
48+ @common_mocks
49+ def test_delete_notfound_on_remove_snapshot(self):
50+ proxy = self.mock_proxy.return_value
51+ proxy.__enter__.return_value = proxy
52+
53+ proxy.remove_snap.side_effect = (
54+ self.mock_rbd.ImageNotFound)
55+
56+ self.driver.delete_snapshot(self.snapshot)
57+
58+ proxy.remove_snap.assert_called_with(self.snapshot_name)
59+ proxy.unprotect_snap.assert_called_with(self.snapshot_name)
60+
61+ @common_mocks
62+ def test_delete_unprotected_snapshot(self):
63+ proxy = self.mock_proxy.return_value
64+ proxy.__enter__.return_value = proxy
65+ proxy.unprotect_snap.side_effect = self.mock_rbd.InvalidArgument
66+
67+ self.driver.delete_snapshot(self.snapshot)
68+ self.assertTrue(proxy.unprotect_snap.called)
69+ self.assertTrue(proxy.remove_snap.called)
70+
71+ @common_mocks
72 def test_get_children_info(self):
73 volume = self.mock_proxy
74 volume.set_snap = mock.Mock()
75diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py
76index d535cc6..f94675e 100644
77--- a/cinder/volume/drivers/rbd.py
78+++ b/cinder/volume/drivers/rbd.py
79@@ -753,6 +753,14 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD,
80 with RBDVolumeProxy(self, volume_name) as volume:
81 try:
82 volume.unprotect_snap(snap_name)
83+ except self.rbd.InvalidArgument:
84+ LOG.info(
85+ _LI("InvalidArgument: Unable to unprotect snapshot %s."),
86+ snap_name)
87+ except self.rbd.ImageNotFound:
88+ LOG.info(
89+ _LI("ImageNotFound: Unable to unprotect snapshot %s."),
90+ snap_name)
91 except self.rbd.ImageBusy:
92 children_list = self._get_children_info(volume, snap_name)
93
94@@ -765,7 +773,11 @@ class RBDDriver(driver.TransferVD, driver.ExtendVD,
95 'snap': snap_name})
96
97 raise exception.SnapshotIsBusy(snapshot_name=snap_name)
98- volume.remove_snap(snap_name)
99+ try:
100+ volume.remove_snap(snap_name)
101+ except self.rbd.ImageNotFound:
102+ LOG.info(_LI("Snapshot %s does not exist in backend."),
103+ snap_name)
104
105 def retype(self, context, volume, new_type, diff, host):
106 """Retypes a volume, allows QoS change only."""
diff --git a/debian/patches/series b/debian/patches/series
index 1f79a8e..6cac686 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
1fix-long-casting.patch1fix-long-casting.patch
2skip-failing-tests.patch2skip-failing-tests.patch
3cinder-306610.patch

Subscribers

People subscribed via source and target branches