Remove deprecated store_data_location

The deprecated configuration option [processing]store_data_location was
removed.

Change-Id: I3f66af7fe67284e0b391188bef7d949cec8feb40
This commit is contained in:
Kaifeng Wang 2019-04-08 17:43:35 +08:00
parent 47b9468838
commit 0e11af26b5
5 changed files with 4 additions and 54 deletions

View File

@ -78,13 +78,6 @@ _OPTS = [
'Possible values are: \'none\', \'database\' and ' 'Possible values are: \'none\', \'database\' and '
'\'swift\'. If set to \'none\', introspection data will ' '\'swift\'. If set to \'none\', introspection data will '
'not be stored.')), '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', cfg.BoolOpt('disk_partitioning_spacing',
default=True, default=True,
help=_('Whether to leave 1 GiB of disk size untouched for ' help=_('Whether to leave 1 GiB of disk size untouched for '

View File

@ -95,16 +95,6 @@ class SwiftStore(object):
LOG.info('Introspection data was stored for node %(node)s in Swift ' LOG.info('Introspection data was stored for node %(node)s in Swift '
'object %(obj_name)s', {'node': node_uuid, 'object %(obj_name)s', {'node': node_uuid,
'obj_name': swift_object_name}) '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): class DatabaseStore(object):

View File

@ -78,25 +78,6 @@ class TestSwiftStore(BaseTest):
db.Node(uuid=self.node_info.uuid, db.Node(uuid=self.node_info.uuid,
state=istate.States.starting).save(session) 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): class TestDatabaseStore(BaseTest):
def setUp(self): def setUp(self):

View File

@ -500,24 +500,6 @@ class TestProcessNode(BaseTest):
self.assertNotIn('logs', self.assertNotIn('logs',
json.loads(swift_conn.create_object.call_args[0][1])) 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) @mock.patch.object(node_cache, 'store_introspection_data', autospec=True)
def test_store_data_with_database(self, store_mock): def test_store_data_with_database(self, store_mock):
CONF.set_override('store_data', 'database', 'processing') CONF.set_override('store_data', 'database', 'processing')

View File

@ -0,0 +1,4 @@
upgrade:
- |
The deprecated configuration option ``[processing]store_data_location``
was removed.