2020import importlib
2121import logging
2222import sys
23- from typing import TYPE_CHECKING , Any , Protocol , TypeVar , runtime_checkable
23+ from typing import Any , Protocol , TypeVar , runtime_checkable
2424
25+ from keystoneauth1 import access as ksa_access
26+ from openstack .compute import v2 as compute_v2
27+ from openstack .image import v2 as image_v2
28+ from openstack .network import v2 as network_v2
2529from osc_lib .cli import client_config
2630from osc_lib import clientmanager
2731from osc_lib import shell
2832import stevedore
2933
30- if TYPE_CHECKING :
31- from keystoneauth1 import access as ksa_access
32- from openstack .compute .v2 import _proxy as compute_proxy
33- from openstack .image .v2 import _proxy as image_proxy
34- from openstack .network .v2 import _proxy as network_proxy
35-
36- from openstackclient .api import object_store_v1
34+ from openstackclient .api import object_store_v1
3735
3836LOG = logging .getLogger (__name__ )
39-
4037PLUGIN_MODULES : list [Any ] = []
41-
4238USER_AGENT = 'python-openstackclient'
4339
4440
@@ -50,23 +46,19 @@ class ClientManager(clientmanager.ClientManager):
5046 in osc-lib so we need to maintain a transition period.
5147 """
5248
53- if TYPE_CHECKING :
54- # we know this will be set by us and will not be nullable
55- auth_ref : ksa_access .AccessInfo
56-
57- # this is a hack to keep mypy happy: the actual attributes are set in
58- # get_plugin_modules below
59- # TODO(stephenfin): Change the types of identity and volume once we've
60- # migrated everything to SDK. Hopefully by then we'll have figured out
61- # how to statically distinguish between the v2 and v3 versions of both
62- # services...
63- # TODO(stephenfin): We also need to migrate object storage...
64- compute : compute_proxy .Proxy
65- identity : Any
66- image : image_proxy .Proxy
67- network : network_proxy .Proxy
68- object_store : object_store_v1 .APIv1
69- volume : Any
49+ # we know this will be set by us and will not be nullable
50+ auth_ref : ksa_access .AccessInfo
51+
52+ # this is a hack to keep mypy happy: the actual attributes are set in
53+ # get_plugin_modules below
54+ # TODO(stephenfin): Change the types of identity, object store and volume
55+ # once we've migrated everything to SDK
56+ compute : compute_v2 .Proxy
57+ identity : Any
58+ image : image_v2 .Proxy
59+ network : network_v2 .Proxy
60+ object_store : object_store_v1 .APIv1
61+ volume : Any
7062
7163 def __init__ (
7264 self ,
0 commit comments