OSC: try fetching ironic-inspector URL from osc-lib

Together with https://review.opendev.org/#/c/664830/ it corrects using
auth_type=none with ironic-inspector.

Change-Id: Iaf94b939359f7f5c8c910ea3b6d601027b043c1c
This commit is contained in:
Dmitry Tantsur 2019-06-12 11:14:16 +02:00
parent e146a841f5
commit 440cd92749

View File

@ -40,8 +40,14 @@ for mversion in range(ironic_inspector_client.MAX_API_VERSION[1] + 1):
def make_client(instance):
url = instance.get_configuration().get('inspector_url')
if not url:
url = instance.get_endpoint_for_service_type(
'baremetal-introspection', interface=instance.interface,
region_name=instance._region_name
)
return ironic_inspector_client.ClientV1(
inspector_url=instance.get_configuration().get('inspector_url'),
inspector_url=url,
session=instance.session,
api_version=instance._api_version[API_NAME],
interface=instance._interface,
@ -49,6 +55,7 @@ def make_client(instance):
def build_option_parser(parser):
# TODO(dtantsur): deprecate these options in favor of more generic OS_*
parser.add_argument('--inspector-api-version',
default=utils.env('INSPECTOR_VERSION',
default=DEFAULT_API_VERSION),