Merge "Do not abort wait_for_provision_state of last_errors becomes non-empty"

This commit is contained in:
Zuul 2018-06-01 13:24:19 +00:00 committed by Gerrit Code Review
commit abd2f08f34
3 changed files with 12 additions and 2 deletions
ironicclient
tests/unit/v1
v1
releasenotes/notes

@ -1578,7 +1578,9 @@ class NodeManagerTest(testtools.TestCase):
def test_wait_for_provision_state(self, mock_get, mock_sleep):
mock_get.side_effect = [
self._fake_node_for_wait('deploying', target='active'),
self._fake_node_for_wait('deploying', target='active'),
# Sometimes non-fatal errors can be recorded in last_error
self._fake_node_for_wait('deploying', target='active',
error='Node locked'),
self._fake_node_for_wait('active')
]

@ -653,7 +653,7 @@ class NodeManager(base.CreateManager):
return
# Note that if expected_state == 'error' we still succeed
if (node.last_error or node.provision_state == 'error' or
if (node.provision_state == 'error' or
node.provision_state.endswith(' failed')):
raise exc.StateTransitionFailed(
_('Node %(node)s failed to reach state %(state)s. '

@ -0,0 +1,8 @@
---
fixes:
- |
Waiting for a provision state to be reached (via CLI ``--wait`` argument or
the ``wait_for_provision_state`` function) no longer aborts when the node's
``last_error`` field gets populated. It can cause a normal deployment to
abort if a heartbeat from the ramdisk fails because of locking - see
`story 2002094 <https://storyboard.openstack.org/#!/story/2002094>`_.