diff --git a/nova/cmd/status.py b/nova/cmd/status.py index 8a7041b062bc..af62ee840192 100644 --- a/nova/cmd/status.py +++ b/nova/cmd/status.py @@ -319,7 +319,7 @@ class UpgradeCommands(upgradecheck.UpgradeCommands): try: utils.raise_if_old_compute() except exception.TooOldComputeService as e: - return upgradecheck.Result(upgradecheck.Code.WARNING, str(e)) + return upgradecheck.Result(upgradecheck.Code.FAILURE, str(e)) return upgradecheck.Result(upgradecheck.Code.SUCCESS) diff --git a/nova/tests/unit/cmd/test_status.py b/nova/tests/unit/cmd/test_status.py index 093b8ac16b6f..b61da4ae9f1b 100644 --- a/nova/tests/unit/cmd/test_status.py +++ b/nova/tests/unit/cmd/test_status.py @@ -474,7 +474,7 @@ class TestUpgradeCheckOldCompute(test.NoDBTestCase): "nova.objects.service.get_minimum_version_all_cells", return_value=too_old): result = self.cmd._check_old_computes() - self.assertEqual(upgradecheck.Code.WARNING, result.code) + self.assertEqual(upgradecheck.Code.FAILURE, result.code) class TestCheckMachineTypeUnset(test.NoDBTestCase): diff --git a/releasenotes/notes/too-old-compute-check-code-7dbcde45cfd23394.yaml b/releasenotes/notes/too-old-compute-check-code-7dbcde45cfd23394.yaml new file mode 100644 index 000000000000..f8e0517401af --- /dev/null +++ b/releasenotes/notes/too-old-compute-check-code-7dbcde45cfd23394.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The upgrade check tooling now returns a non-zero exit code in the presence + of compute node services that are too old. This is to avoid situations in + which Nova control services fail to start after an upgrade.