Consider dropping check on power state

This patch set stops to check the power state of the physical machine
before deploy.

(cherry picked from commit 49a85dba98)
Conflicts:
	ironic_discoverd/introspect.py
	ironic_discoverd/test/test_introspect.py

Change-Id: Icde18ec2fffd269605e78b1d5a9a0c080929a5b5
Closes-Bug: #1414986
This commit is contained in:
YuikoTakada 2015-03-02 03:59:52 +00:00 committed by Dmitry Tantsur
parent fbd8127f36
commit 0c70a30623
2 changed files with 0 additions and 23 deletions

View File

@ -27,7 +27,6 @@ from ironic_discoverd import utils
LOG = logging.getLogger("ironic_discoverd.introspect")
# See http://specs.openstack.org/openstack/ironic-specs/specs/kilo/new-ironic-state-machine.html # noqa
VALID_STATES = {'enroll', 'manageable', 'inspecting'}
VALID_POWER_STATES = {'power off'}
def introspect(uuid, setup_ipmi_credentials=False):
@ -56,12 +55,6 @@ def introspect(uuid, setup_ipmi_credentials=False):
msg = ('Refusing to introspect node %s with provision state "%s" '
'and maintenance mode off')
raise utils.Error(msg % (node.uuid, provision_state))
power_state = node.power_state
if power_state and power_state.lower() not in VALID_POWER_STATES:
msg = ('Refusing to introspect node %s with power state "%s" '
'and maintenance mode off')
raise utils.Error(msg % (node.uuid, power_state))
else:
LOG.info('Node %s is in maintenance mode, skipping power and provision'
' states check')

View File

@ -292,19 +292,3 @@ class TestIntrospect(test_base.NodeTest):
self.assertEqual(0, cli.node.set_power_state.call_count)
self.assertEqual(0, cli.node.update.call_count)
self.assertFalse(add_mock.called)
def test_wrong_power_state(self, client_mock, add_mock, filters_mock):
self.node.power_state = 'power on'
cli = client_mock.return_value
cli.node.get.return_value = self.node
self.assertRaisesRegexp(
utils.Error,
'node uuid with power state "power on"',
introspect.introspect, self.uuid)
self.assertEqual(0, cli.node.list_ports.call_count)
self.assertEqual(0, filters_mock.call_count)
self.assertEqual(0, cli.node.set_power_state.call_count)
self.assertEqual(0, cli.node.update.call_count)
self.assertFalse(add_mock.called)