nova-status: return 255 for unexpected errors
This came up during review of I687dd7317703a1bb76c197ebba849ca368c0872e. Change-Id: I2dd62e994957d4cc8cc4a8b23a604b03815f2639
This commit is contained in:
parent
3d45ab2045
commit
7a69da4b4f
@ -61,14 +61,16 @@ Upgrade
|
|||||||
service catalog.
|
service catalog.
|
||||||
|
|
||||||
**Return Codes**
|
**Return Codes**
|
||||||
|
::
|
||||||
|
|
||||||
0) All upgrade readiness checks passed successfully and there is nothing
|
0) All upgrade readiness checks passed successfully and there is nothing
|
||||||
to do.
|
to do.
|
||||||
1) At least one check encountered an issue and requires further
|
1) At least one check encountered an issue and requires further
|
||||||
investigation. This is considered a warning but the upgrade may be OK.
|
investigation. This is considered a warning but the upgrade may be OK.
|
||||||
2) There was an upgrade status check failure that needs to be
|
2) There was an upgrade status check failure that needs to be
|
||||||
investigated. This should be considered something that stops an
|
investigated. This should be considered something that stops an
|
||||||
upgrade.
|
upgrade.
|
||||||
|
255) An unexpected error occurred.
|
||||||
|
|
||||||
**History of Checks**
|
**History of Checks**
|
||||||
|
|
||||||
|
@ -205,5 +205,5 @@ def main():
|
|||||||
return(ret)
|
return(ret)
|
||||||
except Exception:
|
except Exception:
|
||||||
print(_('Error:\n%s') % traceback.format_exc())
|
print(_('Error:\n%s') % traceback.format_exc())
|
||||||
# This is 10 so it's not confused with the upgrade check exit codes.
|
# This is 255 so it's not confused with the upgrade check exit codes.
|
||||||
return 10
|
return 255
|
||||||
|
@ -74,7 +74,7 @@ class TestNovaStatusMain(test.NoDBTestCase):
|
|||||||
mock_fn = mock.Mock(side_effect=Exception('wut'))
|
mock_fn = mock.Mock(side_effect=Exception('wut'))
|
||||||
mock_get_action_fn.return_value = (mock_fn, [], {})
|
mock_get_action_fn.return_value = (mock_fn, [], {})
|
||||||
|
|
||||||
self._check_main(expected_return_value=10)
|
self._check_main(expected_return_value=255)
|
||||||
output = self.output.getvalue()
|
output = self.output.getvalue()
|
||||||
self.assertIn('Error:', output)
|
self.assertIn('Error:', output)
|
||||||
# assert the traceback is in the output
|
# assert the traceback is in the output
|
||||||
|
Loading…
x
Reference in New Issue
Block a user