Stop trying to power off nodes if manage_boot is False

When manage_boot is False, we do not power on the machines on starting
introspection, nor do we power them off on aborting. We should not
power off on finishing introspection either, let's leave it up to ironic.

Change-Id: If8115f8d592e1b24b07ef52bcd703d10763c1f00
Story: #1528920
This commit is contained in:
Dmitry Tantsur 2019-10-18 13:53:17 +02:00
parent 4d569fa720
commit 85267e881c
3 changed files with 15 additions and 1 deletions

View File

@ -286,7 +286,7 @@ def _process_node(node_info, node, introspection_data):
resp = {'uuid': node.uuid}
# determine how to handle power
if keep_power_on:
if keep_power_on or not node_info.manage_boot:
power_action = False
else:
power_action = CONF.processing.power_off

View File

@ -551,6 +551,15 @@ class TestProcessNode(BaseTest):
finished_mock.assert_called_once_with(
self.node_info, istate.Events.finish)
@mock.patch.object(node_cache.NodeInfo, 'finished', autospec=True)
def test_no_manage_boot(self, finished_mock):
self.node_info._manage_boot = False
process._process_node(self.node_info, self.node, self.data)
self.assertFalse(self.cli.node.set_power_state.called)
finished_mock.assert_called_once_with(
self.node_info, istate.Events.finish)
@mock.patch.object(swift, 'SwiftAPI', autospec=True)
def test_store_data_with_swift(self, swift_mock):
CONF.set_override('store_data', 'swift', 'processing')

View File

@ -0,0 +1,5 @@
---
fixes:
- |
No longer tries to power off nodes after introspection if ``manage_boot``
is ``False``.