From 6f8342955ea657998d4f0632cde598cadae8c1fd Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 29 Jul 2015 14:21:22 +0200 Subject: [PATCH] Require ironic API version 1.6 This is Kilo, so make it clear in README that we actually still support it (only stand alone case). Change-Id: I9a5bd97a2a33a12311626bb3fae878bfb5c9d53c --- README.rst | 12 ++++++++++-- ironic_inspector/test/test_utils.py | 6 ++++-- ironic_inspector/utils.py | 7 ++++++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 194400b71..6423cbef8 100644 --- a/README.rst +++ b/README.rst @@ -31,6 +31,10 @@ CONTRIBUTING.rst_ for instructions on how to contribute. Version Support Matrix ---------------------- +**ironic-inspector** currently requires bare metal API version ``1.6`` to be +provided by Ironic. This version is available starting with Ironic Kilo +release. + Here is a mapping between Ironic versions and supported **ironic-inspector** versions. The Standalone column shows which **ironic-inspector** versions can be used in standalone mode with each Ironic version. The Inspection Interface @@ -44,11 +48,15 @@ inspection interface in each version of Ironic. +==============+==========+====================+ |Juno |1.0 |N/A | +--------------+----------+--------------------+ -|Kilo |1.0 - 1.1 |1.0 - 1.1 | +|Kilo |1.0 - 2.2 |1.0 - 1.1 | +--------------+----------+--------------------+ -|Liberty |1.1 - 2.X |2.X | +|Liberty |1.1 - 2.X |2.0 - 2.X | +--------------+----------+--------------------+ +.. note:: + ``2.X`` means we don't have specific plans on deprecating support for this + Ironic version. This does not imply that we'll support it forever though. + Workflow -------- diff --git a/ironic_inspector/test/test_utils.py b/ironic_inspector/test/test_utils.py index 7eacda4f9..4d46e8f02 100644 --- a/ironic_inspector/test/test_utils.py +++ b/ironic_inspector/test/test_utils.py @@ -46,7 +46,8 @@ class TestCheckAuth(base.BaseTest): fake_ironic_url) utils.get_client(fake_token) args = {'os_auth_token': fake_token, - 'ironic_url': fake_ironic_url} + 'ironic_url': fake_ironic_url, + 'os_ironic_api_version': '1.6'} mock_client.assert_called_once_with(1, **args) @mock.patch.object(client, 'get_client') @@ -57,7 +58,8 @@ class TestCheckAuth(base.BaseTest): 'os_auth_url': CONF.ironic.os_auth_url, 'os_tenant_name': CONF.ironic.os_tenant_name, 'os_endpoint_type': CONF.ironic.os_endpoint_type, - 'os_service_type': CONF.ironic.os_service_type} + 'os_service_type': CONF.ironic.os_service_type, + 'os_ironic_api_version': '1.6'} mock_client.assert_called_once_with(1, **args) @mock.patch.object(auth_token, 'AuthProtocol') diff --git a/ironic_inspector/utils.py b/ironic_inspector/utils.py index 633bcff78..dc61d3a10 100644 --- a/ironic_inspector/utils.py +++ b/ironic_inspector/utils.py @@ -37,6 +37,9 @@ RETRY_DELAY = 5 GREEN_POOL = None +# 1.6 is a Kilo API version, which has all we need and is pretty well tested +DEFAULT_IRONIC_API_VERSION = '1.6' + class Error(Exception): """Inspector exception.""" @@ -61,7 +64,8 @@ def spawn_n(*args, **kwargs): return GREEN_POOL.spawn_n(*args, **kwargs) -def get_client(token=None): # pragma: no cover +def get_client(token=None, + api_version=DEFAULT_IRONIC_API_VERSION): # pragma: no cover """Get Ironic client instance.""" # NOTE: To support standalone ironic without keystone if CONF.ironic.auth_strategy == 'noauth': @@ -85,6 +89,7 @@ def get_client(token=None): # pragma: no cover endpoint_type=CONF.ironic.os_endpoint_type) args = {'os_auth_token': token, 'ironic_url': ironic_url} + args['os_ironic_api_version'] = api_version return client.get_client(1, **args)