Rename plugin root_device_hint -> raid_device
We'll soon have root_device_hints plugin, so it will become confusing. Also added a test that we can use it under new name. Change-Id: I049e049002cb25afc5aadb9a7a9e5d026a6810fd
This commit is contained in:
parent
ff08bf95e2
commit
7343cad09f
@ -347,7 +347,7 @@ Here are some plugins that can be additionally enabled:
|
|||||||
|
|
||||||
``example``
|
``example``
|
||||||
example plugin logging it's input and output.
|
example plugin logging it's input and output.
|
||||||
``root_device_hint``
|
``raid_device`` (deprecated name ``root_device_hint``)
|
||||||
gathers block devices from ramdisk and exposes root device in multiple
|
gathers block devices from ramdisk and exposes root device in multiple
|
||||||
runs.
|
runs.
|
||||||
``extra_hardware``
|
``extra_hardware``
|
||||||
|
@ -19,10 +19,10 @@ from ironic_inspector.common.i18n import _LI, _LW
|
|||||||
from ironic_inspector.plugins import base
|
from ironic_inspector.plugins import base
|
||||||
|
|
||||||
|
|
||||||
LOG = log.getLogger('ironic_inspector.plugins.root_device_hint')
|
LOG = log.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RootDeviceHintHook(base.ProcessingHook):
|
class RaidDeviceDetection(base.ProcessingHook):
|
||||||
"""Processing hook for learning the root device after RAID creation.
|
"""Processing hook for learning the root device after RAID creation.
|
||||||
|
|
||||||
The plugin can figure out the root device in 2 runs. First, it saves the
|
The plugin can figure out the root device in 2 runs. First, it saves the
|
@ -11,15 +11,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from ironic_inspector.plugins import root_device_hint
|
from ironic_inspector.plugins import base
|
||||||
|
from ironic_inspector.plugins import raid_device
|
||||||
from ironic_inspector.test import base as test_base
|
from ironic_inspector.test import base as test_base
|
||||||
|
|
||||||
|
|
||||||
class TestRootDeviceHint(test_base.NodeTest):
|
class TestRaidDeviceDetection(test_base.NodeTest):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestRootDeviceHint, self).setUp()
|
super(TestRaidDeviceDetection, self).setUp()
|
||||||
self.hook = root_device_hint.RootDeviceHintHook()
|
self.hook = raid_device.RaidDeviceDetection()
|
||||||
|
|
||||||
def _before_update(self, introspection_data):
|
def _before_update(self, introspection_data):
|
||||||
node_patches = []
|
node_patches = []
|
||||||
@ -29,6 +30,14 @@ class TestRootDeviceHint(test_base.NodeTest):
|
|||||||
self.assertFalse(ports_patches)
|
self.assertFalse(ports_patches)
|
||||||
return node_patches
|
return node_patches
|
||||||
|
|
||||||
|
def test_loadable_by_name(self):
|
||||||
|
names = ('raid_device', 'root_device_hint')
|
||||||
|
base.CONF.set_override('processing_hooks', ','.join(names),
|
||||||
|
'processing')
|
||||||
|
for name in names:
|
||||||
|
ext = base.processing_hooks_manager()[name]
|
||||||
|
self.assertIsInstance(ext.obj, raid_device.RaidDeviceDetection)
|
||||||
|
|
||||||
def test_missing_local_gb(self):
|
def test_missing_local_gb(self):
|
||||||
introspection_data = {}
|
introspection_data = {}
|
||||||
self.hook.before_processing(introspection_data)
|
self.hook.before_processing(introspection_data)
|
@ -27,7 +27,9 @@ ironic_inspector.hooks.processing =
|
|||||||
ramdisk_error = ironic_inspector.plugins.standard:RamdiskErrorHook
|
ramdisk_error = ironic_inspector.plugins.standard:RamdiskErrorHook
|
||||||
example = ironic_inspector.plugins.example:ExampleProcessingHook
|
example = ironic_inspector.plugins.example:ExampleProcessingHook
|
||||||
extra_hardware = ironic_inspector.plugins.extra_hardware:ExtraHardwareHook
|
extra_hardware = ironic_inspector.plugins.extra_hardware:ExtraHardwareHook
|
||||||
root_device_hint = ironic_inspector.plugins.root_device_hint:RootDeviceHintHook
|
raid_device = ironic_inspector.plugins.raid_device:RaidDeviceDetection
|
||||||
|
# Deprecated name
|
||||||
|
root_device_hint = ironic_inspector.plugins.raid_device:RaidDeviceDetection
|
||||||
ironic_inspector.hooks.node_not_found =
|
ironic_inspector.hooks.node_not_found =
|
||||||
example = ironic_inspector.plugins.example:example_not_found_hook
|
example = ironic_inspector.plugins.example:example_not_found_hook
|
||||||
oslo.config.opts =
|
oslo.config.opts =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user