Fix ironic inspector rule registration

Use a specific inspector API version (1.12, the latest in Queens) to
ensure that new releases of ironic inspector don't break rule
registration.

This was happening because the client object created in the
os_ironic_inspector_rule module uses the maximum API version known to
the client.

Change-Id: I8c15cd874e147545b0604427771d412b482e5380
Story: 2003129
Task: 23250
This commit is contained in:
Mark Goddard 2018-08-01 14:36:28 +01:00
parent 10382bce9e
commit f0b84702ee

View File

@ -80,10 +80,12 @@ def _build_client(module):
"""Create and return an Ironic inspector client."""
cloud = shade.operator_cloud(**module.params)
session = cloud.cloud_config.get_session()
# API 1.12 is the latest API version available in Queens.
api_version = (1, 12)
client = ironic_inspector_client.v1.ClientV1(
inspector_url=module.params['inspector_url'],
session=session, region_name=module.params['region_name'],
api_version=ironic_inspector_client.v1.MAX_API_VERSION)
api_version=api_version)
return client