diff --git a/doc/source/man/nova-status.rst b/doc/source/man/nova-status.rst index e7b0bd31c2b6..5d38911a8efa 100644 --- a/doc/source/man/nova-status.rst +++ b/doc/source/man/nova-status.rst @@ -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** diff --git a/nova/cmd/status.py b/nova/cmd/status.py index 3f3e40d77e36..29d837882356 100644 --- a/nova/cmd/status.py +++ b/nova/cmd/status.py @@ -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 diff --git a/nova/tests/unit/cmd/test_status.py b/nova/tests/unit/cmd/test_status.py index 38b8675be72d..7613ab6c0a39 100644 --- a/nova/tests/unit/cmd/test_status.py +++ b/nova/tests/unit/cmd/test_status.py @@ -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