Merge "nova-status: return 255 for unexpected errors"

This commit is contained in:
Jenkins
2017-01-04 21:36:40 +00:00
committed by Gerrit Code Review
3 changed files with 12 additions and 10 deletions

View File

@@ -61,6 +61,7 @@ Upgrade
service catalog.
**Return Codes**
::
0) All upgrade readiness checks passed successfully and there is nothing
to do.
@@ -69,6 +70,7 @@ Upgrade
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**

View File

@@ -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

View File

@@ -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