From 66f318b339ec4250ffa42c6239c76ca96942ecd6 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 7 Mar 2018 13:24:42 +0100 Subject: [PATCH] Change the default discovery driver to fake-hardware The fake classic driver will be removed this release. Depends-On: Ia0e95cbc1bb4dbd32793705b876ab8b474b753ad Change-Id: I85f2a2a3ed1ca689c639c60e86853c821e808105 --- devstack/plugin.sh | 1 + doc/source/user/usage.rst | 6 +++--- ironic_inspector/conf/discovery.py | 2 +- ironic_inspector/test/unit/test_plugins_discovery.py | 5 +++-- .../notes/discovery-default-driver-94f990bb0676369b.yaml | 6 ++++++ 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/discovery-default-driver-94f990bb0676369b.yaml diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1b0f184d7..6e215fbf3 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -440,6 +440,7 @@ elif [[ "$1" == "stack" && "$2" == "test-config" ]]; then iniset $TEMPEST_CONFIG service_available ironic_inspector True if [ -n "$IRONIC_INSPECTOR_NODE_NOT_FOUND_HOOK" ]; then iniset $TEMPEST_CONFIG baremetal_introspection auto_discovery_feature True + iniset $TEMPEST_CONFIG baremetal_introspection auto_discovery_default_driver fake-hardware fi fi fi diff --git a/doc/source/user/usage.rst b/doc/source/user/usage.rst index 8da2e022f..5258afc7a 100644 --- a/doc/source/user/usage.rst +++ b/doc/source/user/usage.rst @@ -219,9 +219,9 @@ Ironic first. For discovery, the configuration file option ``node_not_found_hook`` should be set to load the hook called ``enroll``. This hook will enroll the unidentified -node into Ironic using the ``fake`` driver (this driver is a configurable -option, set ``enroll_node_driver`` in the **ironic-inspector** configuration -file, to the Ironic driver you want). +node into Ironic using the ``fake-hardware`` hardware type. (This is +a configurable option; set ``enroll_node_driver``, in the **ironic-inspector** +configuration file, to the Ironic hardware type or classic driver you want.) The ``enroll`` hook will also set the ``ipmi_address`` property on the new node, if its available in the introspection data we received, diff --git a/ironic_inspector/conf/discovery.py b/ironic_inspector/conf/discovery.py index 296caa002..c32a32026 100644 --- a/ironic_inspector/conf/discovery.py +++ b/ironic_inspector/conf/discovery.py @@ -18,7 +18,7 @@ from ironic_inspector.common.i18n import _ _OPTS = [ cfg.StrOpt('enroll_node_driver', - default='fake', + default='fake-hardware', help=_('The name of the Ironic driver used by the enroll ' 'hook when creating a new node in Ironic.')), ] diff --git a/ironic_inspector/test/unit/test_plugins_discovery.py b/ironic_inspector/test/unit/test_plugins_discovery.py index 656ba0766..ae9d55c31 100644 --- a/ironic_inspector/test/unit/test_plugins_discovery.py +++ b/ironic_inspector/test/unit/test_plugins_discovery.py @@ -48,7 +48,8 @@ class TestEnrollNodeNotFoundHook(test_base.NodeTest): discovery.enroll_node_not_found_hook(introspection_data) - mock_create_node.assert_called_once_with('fake', ironic=self.ironic, + mock_create_node.assert_called_once_with('fake-hardware', + ironic=self.ironic, driver_info={}) mock_check_existing.assert_called_once_with( introspection_data, {}, self.ironic) @@ -66,7 +67,7 @@ class TestEnrollNodeNotFoundHook(test_base.NodeTest): discovery.enroll_node_not_found_hook(introspection_data) mock_create_node.assert_called_once_with( - 'fake', ironic=self.ironic, + 'fake-hardware', ironic=self.ironic, driver_info={'ipmi_address': '1.2.3.4'}) mock_check_existing.assert_called_once_with( expected_data, {'ipmi_address': '1.2.3.4'}, self.ironic) diff --git a/releasenotes/notes/discovery-default-driver-94f990bb0676369b.yaml b/releasenotes/notes/discovery-default-driver-94f990bb0676369b.yaml new file mode 100644 index 000000000..0f355ac13 --- /dev/null +++ b/releasenotes/notes/discovery-default-driver-94f990bb0676369b.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The ``[discovery]enroll_node_driver`` option, specifying the hardware type + or driver to use for newly discovered nodes, was changed from ``fake`` + classic driver to ``fake-hardware`` hardware type.