[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:
@@ -31,6 +31,7 @@ PROVISIONING_VERSIONS = {
|
||||
'provide': 4,
|
||||
'rescue': 38,
|
||||
'unrescue': 38,
|
||||
'unhold': 85,
|
||||
}
|
||||
"""API microversions introducing provisioning verbs."""
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user