Merge "nova-status: return 255 for unexpected errors"
This commit is contained in:
@@ -61,14 +61,16 @@ Upgrade
|
||||
service catalog.
|
||||
|
||||
**Return Codes**
|
||||
::
|
||||
|
||||
0) All upgrade readiness checks passed successfully and there is nothing
|
||||
to do.
|
||||
1) At least one check encountered an issue and requires further
|
||||
investigation. This is considered a warning but the upgrade may be OK.
|
||||
2) There was an upgrade status check failure that needs to be
|
||||
investigated. This should be considered something that stops an
|
||||
upgrade.
|
||||
0) All upgrade readiness checks passed successfully and there is nothing
|
||||
to do.
|
||||
1) At least one check encountered an issue and requires further
|
||||
investigation. This is considered a warning but the upgrade may be OK.
|
||||
2) There was an upgrade status check failure that needs to be
|
||||
investigated. This should be considered something that stops an
|
||||
upgrade.
|
||||
255) An unexpected error occurred.
|
||||
|
||||
**History of Checks**
|
||||
|
||||
|
@@ -317,5 +317,5 @@ def main():
|
||||
return(ret)
|
||||
except Exception:
|
||||
print(_('Error:\n%s') % traceback.format_exc())
|
||||
# This is 10 so it's not confused with the upgrade check exit codes.
|
||||
return 10
|
||||
# This is 255 so it's not confused with the upgrade check exit codes.
|
||||
return 255
|
||||
|
@@ -83,7 +83,7 @@ class TestNovaStatusMain(test.NoDBTestCase):
|
||||
mock_fn = mock.Mock(side_effect=Exception('wut'))
|
||||
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()
|
||||
self.assertIn('Error:', output)
|
||||
# assert the traceback is in the output
|
||||
|
Reference in New Issue
Block a user