From 1d914dd9ad9cb9e5d7bba2dab50d9e292c149842 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Wed, 29 Nov 2017 11:17:19 -0600 Subject: Fix SDK Connection creation alternative to Profile Do a dummy import to determine which SDK is installed (Pre/post merge). This solves the DevStack error "Cloud defaults was not found" in -tips jobs. Depends-On: Ia111f127fbdceac2afe20fd9d1fe032145cdd72c Change-Id: I60c2d418dd5a393eee2cc2a5c2fdebfffdabf2d3 --- openstackclient/network/client.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'openstackclient/network/client.py') diff --git a/openstackclient/network/client.py b/openstackclient/network/client.py index 3566bfe5..6f74303d 100644 --- a/openstackclient/network/client.py +++ b/openstackclient/network/client.py @@ -14,10 +14,15 @@ import logging from openstack import connection + + +# NOTE(dtroyer): Attempt an import to detect if the SDK installed is new +# enough to not use Profile. If so, use that. try: - from openstack import profile -except ImportError: + from openstack.config import loader as config # noqa profile = None +except ImportError: + from openstack import profile from osc_lib import utils from openstackclient.i18n import _ @@ -39,7 +44,7 @@ def make_client(instance): if profile is None: # New SDK conn = connection.Connection( - cloud_config=instance._cli_options, + config=instance._cli_options, session=instance.session) else: prof = profile.Profile() -- cgit v1.2.1