diff --git a/nova/api/openstack/placement/util.py b/nova/api/openstack/placement/util.py index d3cd3841cf90..2fa4987ad62e 100644 --- a/nova/api/openstack/placement/util.py +++ b/nova/api/openstack/placement/util.py @@ -109,7 +109,7 @@ def json_error_formatter(body, status, title, environ): microversion = nova.api.openstack.placement.microversion if status_code == 406 and microversion.MICROVERSION_ENVIRON not in environ: error_dict['max_version'] = microversion.max_version_string() - error_dict['min_version'] = microversion.max_version_string() + error_dict['min_version'] = microversion.min_version_string() return {'errors': [error_dict]} diff --git a/nova/tests/unit/api/openstack/placement/test_util.py b/nova/tests/unit/api/openstack/placement/test_util.py index dd89acbc805b..b9f01a013901 100644 --- a/nova/tests/unit/api/openstack/placement/test_util.py +++ b/nova/tests/unit/api/openstack/placement/test_util.py @@ -13,6 +13,7 @@ """Unit tests for the utility functions used by the placement API.""" +import fixtures from oslo_middleware import request_id import webob @@ -143,6 +144,15 @@ class TestJSONErrorFormatter(test.NoDBTestCase): def setUp(self): super(TestJSONErrorFormatter, self).setUp() self.environ = {} + # TODO(jaypipes): Remove this when we get more than a single version + # in the placement API. The fact that we only had a single version was + # masking a bug in the utils code. + _versions = [ + '1.0', + '1.1', + ] + mod_str = 'nova.api.openstack.placement.microversion.VERSIONS' + self.useFixture(fixtures.MonkeyPatch(mod_str, _versions)) def test_status_to_int_code(self): body = ''