Merge ~chris.macnaughton/ubuntu/+source/python-os-brick:bug/1865754 into ~ubuntu-server-dev/ubuntu/+source/python-os-brick:stable/ussuri

Proposed by Chris MacNaughton
Status: Merged
Merge reported by: Corey Bryant
Merged at revision: d2ae94dc7bf3a6457758f5b3c014229f6a8636a2
Proposed branch: ~chris.macnaughton/ubuntu/+source/python-os-brick:bug/1865754
Merge into: ~ubuntu-server-dev/ubuntu/+source/python-os-brick:stable/ussuri
Diff against target: 103 lines (+82/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/lp1865754-fix-rbd-connector-for-octopus.patch (+74/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Corey Bryant Approve
Review via email: mp+391267@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :
Revision history for this message
Corey Bryant (corey.bryant) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 59e444a..cbeeb6f 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+python-os-brick (3.0.1-0ubuntu1.3) UNRELEASED; urgency=medium
7+
8+ * d/p/lp1865754-fix-rbd-connector-for-octopus.patch: Fix RBD connector to
9+ work with Ceph Octopus (LP: #1865754).
10+
11+ -- Chris MacNaughton <chris.macnaughton@canonical.com> Wed, 23 Sep 2020 15:17:56 +0000
12+
13 python-os-brick (3.0.1-0ubuntu1.2) focal-security; urgency=medium
14
15 * d/gbp.conf: Create stable/ussuri branch.
16diff --git a/debian/patches/lp1865754-fix-rbd-connector-for-octopus.patch b/debian/patches/lp1865754-fix-rbd-connector-for-octopus.patch
17new file mode 100644
18index 0000000..e7e6eaa
19--- /dev/null
20+++ b/debian/patches/lp1865754-fix-rbd-connector-for-octopus.patch
21@@ -0,0 +1,74 @@
22+From 91c73a433a2b3675e661f1fe007b58c2bfaff757 Mon Sep 17 00:00:00 2001
23+From: Brian Rosmaita <rosmaita.fossdev@gmail.com>
24+Date: Tue, 08 Sep 2020 11:44:25 -0400
25+Subject: [PATCH] New fix for rbd connector to work with ceph octopus
26+
27+Found while testing cinder-backup with ceph on Ubuntu Focal, which
28+installs ceph Octopus. Octopus apparently enforces the requirement
29+that the config file contain a '[global]' section for general
30+requirements. The '[global]' section goes back at least to ceph
31+Hammer [0], so we will simply add it to the temporary ceph config
32+file that os-brick generates in the RBDConnector class.
33+
34+[0] https://docs.ceph.com/docs/hammer/rados/configuration/mon-config-ref/
35+
36+Co-authored-by: Alex Kavanagh <alex@ajkavanagh.co.uk>
37+Co-authored-by: Ivan Kolodyazhny <e0ne@e0ne.info>
38+
39+Change-Id: I86eb31535d990291945de5d9846b1a03157ec2cf
40+Closes-bug: #1865754
41+(cherry picked from commit c6ad4d864c6088b6686919dd0229c926bce7073a)
42+(cherry picked from commit 474583b4f8469f7957d6ffbf62829b516189aeae)
43+---
44+
45+diff --git a/os_brick/initiator/connectors/rbd.py b/os_brick/initiator/connectors/rbd.py
46+index f62c06b..5135dd8 100644
47+--- a/os_brick/initiator/connectors/rbd.py
48++++ b/os_brick/initiator/connectors/rbd.py
49+@@ -97,7 +97,12 @@
50+ try:
51+ fd, ceph_conf_path = tempfile.mkstemp(prefix="brickrbd_")
52+ with os.fdopen(fd, 'w') as conf_file:
53+- conf_file.writelines([mon_hosts, "\n", keyring, "\n"])
54++ # Bug #1865754 - '[global]' has been the appropriate
55++ # place for this stuff since at least Hammer, but in
56++ # Octopus (15.2.0+), Ceph began enforcing this.
57++ conf_file.writelines(["[global]", "\n",
58++ mon_hosts, "\n",
59++ keyring, "\n"])
60+ return ceph_conf_path
61+ except IOError:
62+ msg = (_("Failed to write data to %s.") % (ceph_conf_path))
63+diff --git a/os_brick/tests/initiator/connectors/test_rbd.py b/os_brick/tests/initiator/connectors/test_rbd.py
64+index b8ce8b9..d001765 100644
65+--- a/os_brick/tests/initiator/connectors/test_rbd.py
66++++ b/os_brick/tests/initiator/connectors/test_rbd.py
67+@@ -171,6 +171,10 @@
68+ self.keyring)
69+ self.assertEqual(conf_path, tmpfile)
70+ mock_mkstemp.assert_called_once_with(prefix='brickrbd_')
71++ # Bug #1865754 - make sure generated config file has a '[global]'
72++ # section
73++ _, args, _ = mockopen().writelines.mock_calls[0]
74++ self.assertIn('[global]', args[0])
75+
76+ @mock.patch.object(priv_rootwrap, 'execute', return_value=None)
77+ def test_connect_local_volume(self, mock_execute):
78+diff --git a/releasenotes/notes/bug-1865754-ceph-octopus-compatibility-0aa9b8bc1b028301.yaml b/releasenotes/notes/bug-1865754-ceph-octopus-compatibility-0aa9b8bc1b028301.yaml
79+new file mode 100644
80+index 0000000..bdd5986
81+--- /dev/null
82++++ b/releasenotes/notes/bug-1865754-ceph-octopus-compatibility-0aa9b8bc1b028301.yaml
83+@@ -0,0 +1,12 @@
84++---
85++fixes:
86++ - |
87++ `Bug #1865754 <https://bugs.launchpad.net/cinder/+bug/1865754>`_:
88++ the ``RBDConnector`` class generates a temporary configuration file
89++ to connect to Ceph. Previously, os-brick did not include a
90++ ``[global]`` section to contain the options it sets, but with the
91++ Octopus release (15.2.0+), Ceph has begun enforcing the presence
92++ of this section marker, which dates back at least to the Hammer
93++ release of Ceph. With this release, os-brick includes the
94++ ``[global]`` section in the generated configuration file, which
95++ should be backward-compatible at least to Ceph Hammer.
96diff --git a/debian/patches/series b/debian/patches/series
97index fb20c1f..d612674 100644
98--- a/debian/patches/series
99+++ b/debian/patches/series
100@@ -1,2 +1,3 @@
101 removes-privacy-breach-in-docs.patch
102 CVE-2020-10755.patch
103+lp1865754-fix-rbd-connector-for-octopus.patch

Subscribers

People subscribed via source and target branches