diff --git a/keystoneauth1/loading/_utils.py b/keystoneauth1/loading/_utils.py index 88e93bac..98326aaa 100644 --- a/keystoneauth1/loading/_utils.py +++ b/keystoneauth1/loading/_utils.py @@ -10,11 +10,16 @@ # License for the specific language governing permissions and limitations # under the License. +import typing as ty + +if ty.TYPE_CHECKING: + from oslo_config import cfg as _cfg + cfg = None _NOT_FOUND = object() -def get_oslo_config(): +def get_oslo_config() -> '_cfg': """Runtime load the oslo.config object. In performance optimization of openstackclient it was determined that even diff --git a/setup.cfg b/setup.cfg index 73da2647..af76217d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -176,3 +176,6 @@ disallow_untyped_defs = true [mypy-keystoneauth1.loading.session] disallow_untyped_defs = true + +[mypy-keystoneauth1.loading._utils] +disallow_untyped_defs = true