From 95fd0d3eb5e814497a48c824760bfa44e6178e12 Mon Sep 17 00:00:00 2001 From: Paymaun Date: Wed, 20 Jul 2022 08:51:12 -0700 Subject: [PATCH] Resolves issue preventing ref docgen. (#551) --- HISTORY.rst | 6 ++++++ azext_iot/common/utility.py | 2 ++ azext_iot/constants.py | 2 +- azext_iot/deviceupdate/providers/loaders.py | 2 ++ azext_iot/sdk/deviceupdate/__init__.py | 3 --- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a97693221..9e009be4e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,12 @@ unreleased +++++++++++++++ +0.16.1 ++++++++++++++++ + +* Fix issue preventing reference docgen. + + 0.16.0 +++++++++++++++ diff --git a/azext_iot/common/utility.py b/azext_iot/common/utility.py index 6747046b3..2d664de54 100644 --- a/azext_iot/common/utility.py +++ b/azext_iot/common/utility.py @@ -580,6 +580,8 @@ def ensure_azure_namespace_path(): from azext_iot.constants import EXTENSION_NAME ext_path = get_extension_path(EXTENSION_NAME) + if not ext_path: + return ext_azure_dir = os.path.join(ext_path, "azure") if os.path.isdir(ext_azure_dir): diff --git a/azext_iot/constants.py b/azext_iot/constants.py index 3c7dc53c3..95fbf8e7f 100644 --- a/azext_iot/constants.py +++ b/azext_iot/constants.py @@ -7,7 +7,7 @@ import os -VERSION = "0.16.0" +VERSION = "0.16.1" EXTENSION_NAME = "azure-iot" EXTENSION_ROOT = os.path.dirname(os.path.abspath(__file__)) EXTENSION_CONFIG_ROOT_KEY = "iotext" diff --git a/azext_iot/deviceupdate/providers/loaders.py b/azext_iot/deviceupdate/providers/loaders.py index 0b9dca912..1a80c3ab7 100644 --- a/azext_iot/deviceupdate/providers/loaders.py +++ b/azext_iot/deviceupdate/providers/loaders.py @@ -31,6 +31,8 @@ def reload_modules() -> None: import importlib ext_path = get_extension_path(EXTENSION_NAME) + if not ext_path: + return ext_azure_dir = os.path.join(ext_path, "azure") if not os.path.isdir(ext_azure_dir): diff --git a/azext_iot/sdk/deviceupdate/__init__.py b/azext_iot/sdk/deviceupdate/__init__.py index 37dcff4a8..55614acbf 100644 --- a/azext_iot/sdk/deviceupdate/__init__.py +++ b/azext_iot/sdk/deviceupdate/__init__.py @@ -3,6 +3,3 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - -from azext_iot.common.utility import ensure_azure_namespace_path -ensure_azure_namespace_path()