[baremetal] Add unhold provision state verb support

Adds support for passing the "unhold" provision state verb
to Ironic. The underlying feature added allows step executions
for cleaning/provisioning (and later service), to pause operations
pending external intervention. This "unhold" provision state verb
is that intervention which unpauses the underlying operation
allowing it to complete normally.

Change-Id: Ic833b1e2f50e3540c2455c161eed08931f023d59
This commit is contained in:
Julia Kreger
2023-09-14 13:49:53 -07:00
parent 1d3da1c86b
commit ae992fc384
3 changed files with 14 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ PROVISIONING_VERSIONS = {
'provide': 4,
'rescue': 38,
'unrescue': 38,
'unhold': 85,
}
"""API microversions introducing provisioning verbs."""

View File

@@ -100,7 +100,7 @@ class Node(_common.ListMixin, resource.Resource):
)
# Ability to query for parent_node, and view the field.
_max_microversion = '1.83'
_max_microversion = '1.85'
# Properties
#: The UUID of the allocation associated with this node. Added in API

View File

@@ -383,6 +383,18 @@ class TestNodeSetProvisionState(base.TestCase):
retriable_status_codes=_common.RETRIABLE_STATUS_CODES,
)
def test_set_provision_state_unhold(self):
result = self.node.set_provision_state(self.session, 'unhold')
self.assertIs(result, self.node)
self.session.put.assert_called_once_with(
'nodes/%s/states/provision' % self.node.id,
json={'target': 'unhold'},
headers=mock.ANY,
microversion='1.85',
retriable_status_codes=_common.RETRIABLE_STATUS_CODES,
)
@mock.patch.object(node.Node, '_translate_response', mock.Mock())
@mock.patch.object(node.Node, '_get_session', lambda self, x: x)