File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434def make_client (instance ):
3535 """Returns a compute service client."""
3636
37- # Defer client imports until we actually need them
37+ # Defer client import until we actually need them
3838 from novaclient import client as nova_client
39- from novaclient import extension
40- try :
41- from novaclient .v2 .contrib import list_extensions
42- except ImportError :
43- from novaclient .v1_1 .contrib import list_extensions
4439
4540 if _compute_api_version is not None :
4641 version = _compute_api_version
@@ -52,7 +47,8 @@ def make_client(instance):
5247 # Set client http_log_debug to True if verbosity level is high enough
5348 http_log_debug = utils .get_effective_log_level () <= logging .DEBUG
5449
55- extensions = [extension .Extension ('list_extensions' , list_extensions )]
50+ extensions = [ext for ext in nova_client .discover_extensions (version )
51+ if ext .name == "list_extensions" ]
5652
5753 # Remember interface only if it is set
5854 kwargs = utils .build_kwargs_dict ('endpoint_type' , instance ._interface )
You can’t perform that action at this time.
0 commit comments