From ca84633fb168831ac19bb78c9fbdf9da238c9bcf Mon Sep 17 00:00:00 2001 From: asarfaty Date: Thu, 26 Mar 2020 12:43:29 +0200 Subject: [PATCH] Fix openstack client for vmware-nsx Do not use the client to get extensions in case the initialization is not done. This can happen when using openstack client command with --help Change-Id: Iccdc47e3f7c53f6f1aa73bb18f85a522efd85093 --- vmware_nsx/osc/v2/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmware_nsx/osc/v2/utils.py b/vmware_nsx/osc/v2/utils.py index 89d247153e..446fadaef8 100644 --- a/vmware_nsx/osc/v2/utils.py +++ b/vmware_nsx/osc/v2/utils.py @@ -14,7 +14,6 @@ # under the License. from osc_lib import utils as osc_utils - cached_extensions = None @@ -24,9 +23,14 @@ def get_extensions(client_manager): global cached_extensions if cached_extensions is not None: return cached_extensions + + extensions = [] + if not client_manager._auth_setup_completed: + # cannot get the extensions from the neutron client + return extensions + # Get supported extensions from the manager data = client_manager.network.extensions() - extensions = [] for s in data: prop = osc_utils.get_item_properties( s, ('Alias',), formatters={})