Merge lp:~gnuoy/nova/bug1314677 into lp:~ubuntu-server-dev/nova/icehouse

Proposed by Liam Young
Status: Merged
Merged at revision: 695
Proposed branch: lp:~gnuoy/nova/bug1314677
Merge into: lp:~ubuntu-server-dev/nova/icehouse
Diff against target: 106 lines (+85/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/cells-json-store.patch (+76/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~gnuoy/nova/bug1314677
Reviewer Review Type Date Requested Status
Corey Bryant Approve
James Page Needs Fixing
Review via email: mp+236321@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Hi Liam

Thanks for the MP; a few comments

1) has this patch been cherry picked upstream for the stable/icehouse branch? If no please submit a review following https://wiki.openstack.org/wiki/StableBranch

2) I'd like to see either a) a full annotate git patch as would be committed upstream or b) appropriate patch headers (see http://dep.debian.net/deps/dep5/) so we can track the heritage of this patch.

Also its good practice to leave the changelog entry as UNRELEASED (instead of trusty) so dch keeps appending to the existing UNRELEASED version.

Cheers

James

review: Needs Fixing
lp:~gnuoy/nova/bug1314677 updated
696. By Liam Young

Copied cells patch from stable/icehouse submission and updated cell patch meta info

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

Looks good. Thanks Liam!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-08-12 19:48:49 +0000
3+++ debian/changelog 2014-09-30 09:26:06 +0000
4@@ -1,3 +1,11 @@
5+nova (1:2014.1.2-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * debian/patches/cells-json-store.patch Fix nova-cells fails when using
8+ JSON file to store cell information
9+ (LP: #1314677)
10+
11+ -- Liam Young <liam.young@canonical.com> Mon, 29 Sep 2014 12:59:24 +0000
12+
13 nova (1:2014.1.2-0ubuntu1) trusty; urgency=medium
14
15 [ Corey Bryant ]
16
17=== added file 'debian/patches/cells-json-store.patch'
18--- debian/patches/cells-json-store.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/cells-json-store.patch 2014-09-30 09:26:06 +0000
20@@ -0,0 +1,76 @@
21+Description: Fix nova cells failing with a json topology file bug
22+Author: Liam Young <liam.young@canonical.com>
23+Bug: https://bugs.launchpad.net/nova/+bug/1314677
24+Forwarded: https://review.openstack.org/#/c/124811/
25+diff --git a/nova/cells/state.py b/nova/cells/state.py
26+index b9112bd..1e12450 100644
27+--- a/nova/cells/state.py
28++++ b/nova/cells/state.py
29+@@ -152,10 +152,7 @@ class CellStateManager(base.Base):
30+ cells_config = CONF.cells.cells_config
31+
32+ if cells_config:
33+- config_path = CONF.find_file(cells_config)
34+- if not config_path:
35+- raise cfg.ConfigFilesNotFoundError(config_files=[cells_config])
36+- return CellStateManagerFile(cell_state_cls, config_path)
37++ return CellStateManagerFile(cell_state_cls)
38+
39+ return CellStateManagerDB(cell_state_cls)
40+
41+@@ -450,8 +447,11 @@ class CellStateManagerDB(CellStateManager):
42+
43+
44+ class CellStateManagerFile(CellStateManager):
45+- def __init__(self, cell_state_cls, cells_config_path):
46+- self.cells_config_path = cells_config_path
47++ def __init__(self, cell_state_cls=None):
48++ cells_config = CONF.cells.cells_config
49++ self.cells_config_path = CONF.find_file(cells_config)
50++ if not self.cells_config_path:
51++ raise cfg.ConfigFilesNotFoundError(config_files=[cells_config])
52+ super(CellStateManagerFile, self).__init__(cell_state_cls)
53+
54+ def _cell_data_sync(self, force=False):
55+diff --git a/nova/tests/cells/test_cells_state_manager.py b/nova/tests/cells/test_cells_state_manager.py
56+index 1c29927..4841e14 100644
57+--- a/nova/tests/cells/test_cells_state_manager.py
58++++ b/nova/tests/cells/test_cells_state_manager.py
59+@@ -16,12 +16,16 @@
60+ Tests For CellStateManager
61+ """
62+
63++import mock
64++import six
65++
66+ from oslo.config import cfg
67+
68+ from nova.cells import state
69+ from nova import db
70+ from nova.db.sqlalchemy import models
71+ from nova import exception
72++from nova.openstack.common import fileutils
73+ from nova import test
74+
75+
76+@@ -78,6 +82,19 @@ class TestCellsStateManager(test.TestCase):
77+ state.CellStateManager)
78+ self.assertEqual(['no_such_file_exists.conf'], e.config_files)
79+
80++ @mock.patch.object(cfg.ConfigOpts, 'find_file')
81++ @mock.patch.object(fileutils, 'read_cached_file')
82++ def test_filemanager_returned(self, mock_read_cached_file, mock_find_file):
83++ mock_find_file.return_value = "/etc/nova/cells.json"
84++ mock_read_cached_file.return_value = (False, six.StringIO({}))
85++ self.flags(cells_config='cells.json', group='cells')
86++ self.assertIsInstance(state.CellStateManager(),
87++ state.CellStateManagerFile)
88++
89++ def test_dbmanager_returned(self):
90++ self.assertIsInstance(state.CellStateManager(),
91++ state.CellStateManagerDB)
92++
93+ def test_capacity_no_reserve(self):
94+ # utilize entire cell
95+ cap = self._capacity(0.0)
96+
97
98=== modified file 'debian/patches/series'
99--- debian/patches/series 2014-08-08 17:43:35 +0000
100+++ debian/patches/series 2014-09-30 09:26:06 +0000
101@@ -1,4 +1,5 @@
102 # Ubuntu specific patches below here. Note these can be dropped eventually.
103+cells-json-store.patch
104 libvirt-convert-cpu-features-attribute-from-list-to-.patch
105 fix-requirements.patch
106 skip_ipv6_test.patch

Subscribers

People subscribed via source and target branches