Do not abort wait_for_provision_state of last_errors becomes non-empty
It can happen if one of heartbeats encounteres "node locked" error, which is normal, because the next heartbeat will succeed. Change-Id: Iaed9b83e199761eac4e0e2157c16ea1efa564c24 Story: #2002094 Task: #19772
This commit is contained in:
parent
69f1bb8c01
commit
8940d72521
|
@ -1578,7 +1578,9 @@ class NodeManagerTest(testtools.TestCase):
|
||||||
def test_wait_for_provision_state(self, mock_get, mock_sleep):
|
def test_wait_for_provision_state(self, mock_get, mock_sleep):
|
||||||
mock_get.side_effect = [
|
mock_get.side_effect = [
|
||||||
self._fake_node_for_wait('deploying', target='active'),
|
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')
|
self._fake_node_for_wait('active')
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -653,7 +653,7 @@ class NodeManager(base.CreateManager):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Note that if expected_state == 'error' we still succeed
|
# 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')):
|
node.provision_state.endswith(' failed')):
|
||||||
raise exc.StateTransitionFailed(
|
raise exc.StateTransitionFailed(
|
||||||
_('Node %(node)s failed to reach state %(state)s. '
|
_('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>`_.
|
Loading…
Reference in New Issue