diff -Nru nova-2014.1.2/debian/changelog nova-2014.1.2/debian/changelog --- nova-2014.1.2/debian/changelog 2014-08-21 14:03:09.000000000 +0000 +++ nova-2014.1.2/debian/changelog 2014-09-12 15:55:29.000000000 +0000 @@ -1,3 +1,11 @@ +nova (1:2014.1.2-0ubuntu1.2) trusty; urgency=medium + + * debian/patches/cells-json-store.patch Fix nova-cells fails when using + JSON file to store cell information + (LP: #1314677) + + -- Liam Young Fri, 12 Sep 2014 15:49:49 +0000 + nova (1:2014.1.2-0ubuntu1.1) trusty-security; urgency=medium * No change rebuild for security: diff -Nru nova-2014.1.2/debian/patches/cells-json-store.patch nova-2014.1.2/debian/patches/cells-json-store.patch --- nova-2014.1.2/debian/patches/cells-json-store.patch 1970-01-01 00:00:00.000000000 +0000 +++ nova-2014.1.2/debian/patches/cells-json-store.patch 2014-09-12 15:31:48.000000000 +0000 @@ -0,0 +1,68 @@ +--- a/nova/cells/state.py ++++ b/nova/cells/state.py +@@ -152,10 +152,7 @@ + cells_config = CONF.cells.cells_config + + if cells_config: +- config_path = CONF.find_file(cells_config) +- if not config_path: +- raise cfg.ConfigFilesNotFoundError(config_files=[cells_config]) +- return CellStateManagerFile(cell_state_cls, config_path) ++ return CellStateManagerFile(cell_state_cls) + + return CellStateManagerDB(cell_state_cls) + +@@ -450,8 +447,11 @@ + + + class CellStateManagerFile(CellStateManager): +- def __init__(self, cell_state_cls, cells_config_path): +- self.cells_config_path = cells_config_path ++ def __init__(self, cell_state_cls=None): ++ cells_config = CONF.cells.cells_config ++ self.cells_config_path = CONF.find_file(cells_config) ++ if not self.cells_config_path: ++ raise cfg.ConfigFilesNotFoundError(config_files=[cells_config]) + super(CellStateManagerFile, self).__init__(cell_state_cls) + + def _cell_data_sync(self, force=False): +--- a/nova/tests/cells/test_cells_state_manager.py ++++ b/nova/tests/cells/test_cells_state_manager.py +@@ -17,14 +17,16 @@ + """ + + from oslo.config import cfg ++import mock ++import six + + from nova.cells import state + from nova import db + from nova.db.sqlalchemy import models + from nova import exception ++from nova.openstack.common import fileutils + from nova import test + +- + FAKE_COMPUTES = [ + ('host1', 1024, 100, 0, 0), + ('host2', 1024, 100, -1, -1), +@@ -78,6 +80,19 @@ + state.CellStateManager) + self.assertEqual(['no_such_file_exists.conf'], e.config_files) + ++ @mock.patch.object(cfg.ConfigOpts, 'find_file') ++ @mock.patch.object(fileutils, 'read_cached_file') ++ def test_filemanager_returned(self, mock_read_cached_file, mock_find_file): ++ mock_find_file.return_value = "/etc/nova/cells.json" ++ mock_read_cached_file.return_value = (False, six.StringIO({})) ++ self.flags(cells_config='cells.json', group='cells') ++ self.assertIsInstance(state.CellStateManager(), ++ state.CellStateManagerFile) ++ ++ def test_dbmanager_returned(self): ++ self.assertIsInstance(state.CellStateManager(), ++ state.CellStateManagerDB) ++ + def test_capacity_no_reserve(self): + # utilize entire cell + cap = self._capacity(0.0) diff -Nru nova-2014.1.2/debian/patches/series nova-2014.1.2/debian/patches/series --- nova-2014.1.2/debian/patches/series 2014-08-13 13:18:48.000000000 +0000 +++ nova-2014.1.2/debian/patches/series 2014-09-12 15:30:32.000000000 +0000 @@ -5,3 +5,4 @@ arm-console-patch.patch update-run-tests.patch libvirt-Handle-unsupported-host-capabilities.patch +cells-json-store.patch