Browse Source

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
changes/21/715221/1
asarfaty 1 year ago
committed by Adit Sarfaty
parent
commit
ca84633fb1
  1. 8
      vmware_nsx/osc/v2/utils.py

8
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={})

Loading…
Cancel
Save