Drop support for introspecting nodes in maintenance mode

Deprecated since liberty. We used to need it because ironic didn't have
'manageable' and 'enroll' states when ironic-inspector was started.

Change-Id: Ia38c40806836820219e86fe277ffd0b2fbd9ec58
Closes-Bug: #1506347
This commit is contained in:
Dmitry Tantsur 2015-12-15 14:20:48 +01:00
parent 1987d79e31
commit 966647548a
4 changed files with 9 additions and 69 deletions

View File

@ -122,17 +122,13 @@ is as follows:
equivalent driver-specific property, as per ``ipmi_address_fields``
configuration option).
With Ironic Liberty use ironic API version ``1.11``, so that new node gets
into ``enroll`` provision state::
Use ironic API version ``1.11`` (introduced in ironic 4.0.0),
so that new node gets into ``enroll`` provision state::
ironic --ironic-api-version 1.11 node-create -d <DRIVER> -i ipmi_address=<ADDRESS>
Providing ``ipmi_address`` allows **ironic-inspector** to distinguish nodes.
* With Ironic Kilo or older, set maintenance mode on nodes.
That's an important step, otherwise Ironic might interfere with introspection
process. This is replaced by ``enroll`` state in Ironic Liberty.
* Start introspection with providing additional parameters:
* ``new_ipmi_password`` IPMI password to set,
@ -143,8 +139,7 @@ is as follows:
* After introspection is finished (watch nodes power state or use
**ironic-inspector** status API) you can move node to ``manageable`` and
then ``available`` states - see `Node States`_. With Ironic Kilo you have to
move a node out of maintenance mode.
then ``available`` states - see `Node States`_.
Note that due to various limitations on password value in different BMC,
**ironic-inspector** will only accept passwords with length between 1 and 20

View File

@ -33,13 +33,6 @@ class BaseTest(test_base.NodeTest):
super(BaseTest, self).setUp()
introspect._LAST_INTROSPECTION_TIME = 0
self.node.power_state = 'power off'
self.node_compat = mock.Mock(driver='pxe_ssh',
uuid='uuid_compat',
driver_info={},
maintenance=True,
# allowed with maintenance=True
power_state='power on',
provision_state='foobar')
self.ports = [mock.Mock(address=m) for m in self.macs]
self.ports_dict = collections.OrderedDict((p.address, p)
for p in self.ports)
@ -140,34 +133,6 @@ class TestIntrospect(BaseTest):
self.node_info.acquire_lock.assert_called_once_with()
self.node_info.release_lock.assert_called_once_with()
def test_with_maintenance(self, client_mock, add_mock, filters_mock):
cli = client_mock.return_value
cli.node.get.return_value = self.node_compat
cli.node.validate.return_value = mock.Mock(power={'result': True})
add_mock.return_value = mock.Mock(uuid=self.node_compat.uuid,
options={},
**{'node.return_value': self.node})
add_mock.return_value.ports.return_value = collections.OrderedDict(
(p.address, p) for p in self.ports)
introspect.introspect(self.node_compat.uuid)
cli.node.get.assert_called_once_with(self.node_compat.uuid)
cli.node.validate.assert_called_once_with(self.node_compat.uuid)
add_mock.return_value.ports.assert_called_once_with()
add_mock.assert_called_once_with(self.node_compat.uuid,
bmc_address=None,
ironic=cli)
add_mock.return_value.add_attribute.assert_called_once_with('mac',
self.macs)
filters_mock.assert_called_with(cli)
cli.node.set_boot_device.assert_called_once_with(self.node_compat.uuid,
'pxe',
persistent=False)
cli.node.set_power_state.assert_called_once_with(self.node_compat.uuid,
'reboot')
def test_no_macs(self, client_mock, add_mock, filters_mock):
cli = self._prepare(client_mock)
self.node_info.ports.return_value = []
@ -398,25 +363,6 @@ class TestSetIpmiCredentials(BaseTest):
add_mock.return_value.set_option.assert_called_once_with(
'new_ipmi_credentials', self.new_creds)
def test_any_state_with_maintenance(self, client_mock, add_mock,
filters_mock):
self.node.provision_state = 'manageable'
self.node.maintenance = True
cli = self._prepare(client_mock)
add_mock.return_value = self.node_info
introspect.introspect(self.uuid, new_ipmi_credentials=self.new_creds)
add_mock.assert_called_once_with(self.uuid,
bmc_address=self.bmc_address,
ironic=cli)
filters_mock.assert_called_with(cli)
self.assertFalse(cli.node.validate.called)
self.assertFalse(cli.node.set_boot_device.called)
self.assertFalse(cli.node.set_power_state.called)
add_mock.return_value.set_option.assert_called_once_with(
'new_ipmi_credentials', self.new_creds)
def test_disabled(self, client_mock, add_mock, filters_mock):
CONF.set_override('enable_setting_ipmi_credentials', False,
'processing')

View File

@ -22,7 +22,7 @@ from oslo_config import cfg
from oslo_log import log
import six
from ironic_inspector.common.i18n import _, _LE, _LW
from ironic_inspector.common.i18n import _, _LE
CONF = cfg.CONF
@ -173,12 +173,6 @@ def get_ipmi_address(node):
def check_provision_state(node, with_credentials=False):
if node.maintenance:
LOG.warning(
_LW('Introspecting nodes in maintenance mode is deprecated, '
'accepted states: %s'), VALID_STATES)
return
state = node.provision_state.lower()
if with_credentials and state not in SET_CREDENTIALS_VALID_STATES:
msg = _('Invalid provision state "%(state)s" for setting IPMI '

View File

@ -0,0 +1,5 @@
---
upgrade:
- Removed support for introspecting nodes in maintenance mode, deprecated in
the liberty cycle. Use "inspecting", "manageable" or "enroll" states
instead.