diff --git a/ironic_inspector/conf/processing.py b/ironic_inspector/conf/processing.py index 678d9695d..4c00f467d 100644 --- a/ironic_inspector/conf/processing.py +++ b/ironic_inspector/conf/processing.py @@ -78,13 +78,6 @@ _OPTS = [ 'Possible values are: \'none\', \'database\' and ' '\'swift\'. If set to \'none\', introspection data will ' 'not be stored.')), - cfg.StrOpt('store_data_location', - help=_('Name of the key to store the location of stored data ' - 'in the extra column of the Ironic database.'), - deprecated_for_removal=True, - deprecated_reason=_('The introspection data could be retrieved ' - 'from inspector API, there is no need to ' - 'keep an extra link in ironic.')), cfg.BoolOpt('disk_partitioning_spacing', default=True, help=_('Whether to leave 1 GiB of disk size untouched for ' diff --git a/ironic_inspector/plugins/introspection_data.py b/ironic_inspector/plugins/introspection_data.py index 0519390a3..e799436a2 100644 --- a/ironic_inspector/plugins/introspection_data.py +++ b/ironic_inspector/plugins/introspection_data.py @@ -95,16 +95,6 @@ class SwiftStore(object): LOG.info('Introspection data was stored for node %(node)s in Swift ' 'object %(obj_name)s', {'node': node_uuid, 'obj_name': swift_object_name}) - # TODO(kaifeng) Remove the deprecated store_data_location at Train - # cycle. - if CONF.processing.store_data_location: - node_info = node_cache.get_node(node_uuid) - # NOTE(kaifeng) node_info is not synced back, while we are not - # using extra in the processing logic, it looks fine at the moment, - # but we should consider refactor in a later time. - node_info.patch([{'op': 'add', 'path': '/extra/%s' % - CONF.processing.store_data_location, - 'value': swift_object_name}]) class DatabaseStore(object): diff --git a/ironic_inspector/test/unit/test_plugins_introspection_data.py b/ironic_inspector/test/unit/test_plugins_introspection_data.py index 61c9d9ba4..58672a67f 100644 --- a/ironic_inspector/test/unit/test_plugins_introspection_data.py +++ b/ironic_inspector/test/unit/test_plugins_introspection_data.py @@ -78,25 +78,6 @@ class TestSwiftStore(BaseTest): db.Node(uuid=self.node_info.uuid, state=istate.States.starting).save(session) - def test_store_data_location(self, swift_mock): - CONF.set_override('store_data_location', 'inspector_data_object', - 'processing') - self._create_node() - swift_conn = swift_mock.return_value - name = 'inspector_data-%s' % self.uuid - patch = [{'path': '/extra/inspector_data_object', - 'value': name, 'op': 'add'}] - expected = self.data - - self.driver.save(self.node_info.uuid, self.data) - - data = introspection_data._filter_data_excluded_keys(self.data) - swift_conn.create_object.assert_called_once_with(name, - json.dumps(data)) - self.assertEqual(expected, - json.loads(swift_conn.create_object.call_args[0][1])) - self.cli.node.update.assert_any_call(self.uuid, patch) - class TestDatabaseStore(BaseTest): def setUp(self): diff --git a/ironic_inspector/test/unit/test_process.py b/ironic_inspector/test/unit/test_process.py index 3d89630ac..98b76fc7d 100644 --- a/ironic_inspector/test/unit/test_process.py +++ b/ironic_inspector/test/unit/test_process.py @@ -500,24 +500,6 @@ class TestProcessNode(BaseTest): self.assertNotIn('logs', json.loads(swift_conn.create_object.call_args[0][1])) - @mock.patch.object(swift, 'SwiftAPI', autospec=True) - def test_store_data_location_with_swift(self, swift_mock): - CONF.set_override('store_data', 'swift', 'processing') - CONF.set_override('store_data_location', 'inspector_data_object', - 'processing') - swift_conn = swift_mock.return_value - name = 'inspector_data-%s' % self.uuid - patch = [{'path': '/extra/inspector_data_object', - 'value': name, 'op': 'add'}] - expected = self.data - - process._process_node(self.node_info, self.node, self.data) - - swift_conn.create_object.assert_called_once_with(name, mock.ANY) - self.assertEqual(expected, - json.loads(swift_conn.create_object.call_args[0][1])) - self.cli.node.update.assert_any_call(self.uuid, patch) - @mock.patch.object(node_cache, 'store_introspection_data', autospec=True) def test_store_data_with_database(self, store_mock): CONF.set_override('store_data', 'database', 'processing') diff --git a/releasenotes/notes/remove-store-data-location-e68462ff6ba257e0.yaml b/releasenotes/notes/remove-store-data-location-e68462ff6ba257e0.yaml new file mode 100644 index 000000000..9bcb2e82f --- /dev/null +++ b/releasenotes/notes/remove-store-data-location-e68462ff6ba257e0.yaml @@ -0,0 +1,4 @@ +upgrade: + - | + The deprecated configuration option ``[processing]store_data_location`` + was removed.