From 61076ad6e98bd52a2242d03c62de68f865a408ba Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Wed, 15 Aug 2018 16:34:04 -0700 Subject: [PATCH] [Multi] Fix references to the SDK models (#7061) And update CI automation to run on the reduced version of Azure management SDKs. --- .travis.yml | 4 +- scripts/ci/test_automation.sh | 11 + scripts/sdk_process/patch_models.py | 226 ++++++++++++++++++ src/command_modules/azure-cli-ams/HISTORY.rst | 4 + .../command_modules/ams/_exception_handler.py | 2 +- src/command_modules/azure-cli-ams/setup.py | 2 +- .../azure-cli-batch/HISTORY.rst | 4 + .../cli/command_modules/batch/_params.py | 3 +- src/command_modules/azure-cli-batch/setup.py | 2 +- .../azure-cli-cosmosdb/HISTORY.rst | 4 + .../cli/command_modules/cosmosdb/_params.py | 2 +- .../command_modules/cosmosdb/_validators.py | 8 +- .../cli/command_modules/cosmosdb/custom.py | 41 ++-- .../azure-cli-cosmosdb/setup.py | 2 +- src/command_modules/azure-cli-dla/HISTORY.rst | 4 + .../azure/cli/command_modules/dla/_params.py | 8 +- src/command_modules/azure-cli-dla/setup.py | 2 +- src/command_modules/azure-cli-dls/HISTORY.rst | 4 + .../azure/cli/command_modules/dls/_params.py | 2 +- src/command_modules/azure-cli-dls/setup.py | 2 +- .../azure-cli-eventhubs/HISTORY.rst | 4 + .../cli/command_modules/eventhubs/_params.py | 2 +- .../cli/command_modules/eventhubs/_utils.py | 2 +- .../cli/command_modules/eventhubs/custom.py | 3 +- .../azure-cli-eventhubs/setup.py | 2 +- .../azure/cli/command_modules/iot/_params.py | 8 +- .../azure-cli-iotcentral/HISTORY.rst | 5 +- .../cli/command_modules/iotcentral/_params.py | 2 +- .../azure-cli-iotcentral/setup.py | 2 +- .../azure/cli/command_modules/lab/_params.py | 2 +- .../azure/cli/command_modules/lab/custom.py | 7 +- .../azure-cli-maps/HISTORY.rst | 4 + .../azure/cli/command_modules/maps/_params.py | 2 +- .../maps/tests/latest/test_maps_commands.py | 2 +- src/command_modules/azure-cli-maps/setup.py | 2 +- .../azure-cli-monitor/HISTORY.rst | 4 + .../cli/command_modules/monitor/_params.py | 4 +- .../monitor/operations/activity_log_alerts.py | 2 +- .../operations/diagnostics_settings.py | 2 +- .../monitor/operations/log_profiles.py | 3 +- .../cli/command_modules/monitor/validators.py | 2 +- .../azure-cli-monitor/setup.py | 2 +- .../azure-cli-redis/HISTORY.rst | 4 + .../cli/command_modules/redis/_params.py | 2 +- src/command_modules/azure-cli-redis/setup.py | 2 +- .../azure-cli-relay/HISTORY.rst | 5 +- .../cli/command_modules/relay/_params.py | 2 +- .../azure/cli/command_modules/relay/_utils.py | 2 +- .../azure/cli/command_modules/relay/custom.py | 1 - src/command_modules/azure-cli-relay/setup.py | 2 +- .../azure-cli-reservations/HISTORY.rst | 4 + .../command_modules/reservations/_params.py | 2 +- .../command_modules/reservations/custom.py | 2 +- .../azure-cli-reservations/setup.py | 2 +- .../azure-cli-servicebus/HISTORY.rst | 4 + .../cli/command_modules/servicebus/_params.py | 2 +- .../cli/command_modules/servicebus/_utils.py | 2 +- .../azure-cli-servicebus/setup.py | 2 +- src/command_modules/azure-cli-sql/HISTORY.rst | 4 + .../azure/cli/command_modules/sql/_params.py | 5 +- src/command_modules/azure-cli-sql/setup.py | 2 +- 61 files changed, 366 insertions(+), 90 deletions(-) create mode 100644 scripts/sdk_process/patch_models.py diff --git a/.travis.yml b/.travis.yml index b4b330c1979..ee9fbe4a636 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,9 @@ jobs: env: TOXENV=py27 script: ./scripts/ci/unittest.sh - stage: verify - env: PURPOSE='Automation' + env: + - PURPOSE='Automation' + - REDUCE_SDK='True' script: ./scripts/ci/test_automation.sh python: 3.6 - stage: verify diff --git a/scripts/ci/test_automation.sh b/scripts/ci/test_automation.sh index 675b7fb2bce..34851b1d074 100755 --- a/scripts/ci/test_automation.sh +++ b/scripts/ci/test_automation.sh @@ -32,6 +32,17 @@ pip install -qqq $ALL_MODULES title 'Installed packages' pip freeze +if [ "$REDUCE_SDK" == "True" ] +then + title 'azure.mgmt file counts' + (cd $(dirname $(which python)); cd ../lib/*/site-packages/azure/mgmt; find . -name '*.py' | wc) + + python $(cd $(dirname $0); cd ..; pwd)/sdk_process/patch_models.py + + title 'azure.mgmt file counts after reduce' + (cd $(dirname $(which python)); cd ../lib/*/site-packages/azure/mgmt; find . -name '*.py' | wc) +fi + target_profile=${AZURE_CLI_TEST_TARGET_PROFILE:-latest} if [ "$target_profile" != "latest" ]; then # example: 2017-03-09-profile diff --git a/scripts/sdk_process/patch_models.py b/scripts/sdk_process/patch_models.py new file mode 100644 index 00000000000..5f0691378ab --- /dev/null +++ b/scripts/sdk_process/patch_models.py @@ -0,0 +1,226 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from enum import Enum +import importlib +import inspect +import logging +from pathlib import Path +import pkgutil +import shutil +import sys +import tempfile + +from msrest.serialization import Model +from msrest.paging import Paged + +_LOGGER = logging.getLogger(__name__) + +copyright_header = b"""# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +""" + +header = copyright_header + b"""from msrest.serialization import Model +from msrest.exceptions import HttpOperationError +""" + +paging_header = copyright_header + b"""from msrest.paging import Paged +""" + +init_file = """ +try: + from .{} import * +except (SyntaxError, ImportError): + from .{} import * +from .{} import * +""" + + +def parse_input(input_parameter): + """From a syntax like package_name#submodule, build a package name + and complete module name. + """ + split_package_name = input_parameter.split('#') + package_name = split_package_name[0] + module_name = package_name.replace("-", ".") + if len(split_package_name) >= 2: + module_name = ".".join([module_name, split_package_name[1]]) + return package_name, module_name + + +def solve_mro(models): + for models_module in models: + models_path = models_module.__path__[0] + _LOGGER.info("Working on %s", models_path) + if Path(models_path, "models_py3.py").exists(): + _LOGGER.info("Skipping since already patched") + return + + # Build the new files in a temp folder + with tempfile.TemporaryDirectory() as temp_folder: + final_models_path = Path(temp_folder, "models") + final_models_path.mkdir() + solve_one_model(models_module, final_models_path) + + # Switch the files + shutil.rmtree(models_path) + shutil.move(final_models_path, models_path) + + +def solve_one_model(models_module, output_folder): + """Will build the compacted models in the output_folder""" + + models_classes = [ + (len(model_class.__mro__), inspect.getfile(model_class), model_class) for model_name, model_class in + vars(models_module).items() + if model_name[0].isupper() and Model in model_class.__mro__ + ] + # Only sort based on the first element in the tuple + models_classes.sort(key=lambda x: x[0]) + + py2_models_classes = [ + (len_mro, path.replace("_py3.py", ".py"), None) + for len_mro, path, _ in models_classes + ] + + paged_models_classes = [ + (inspect.getfile(model_class), model_class) for model_name, model_class in vars(models_module).items() + if model_name[0].isupper() and Paged in model_class.__mro__ + ] + + enum_models_classes = [ + (inspect.getfile(model_class), model_class) for model_name, model_class in vars(models_module).items() + if model_name[0].isupper() and Enum in model_class.__mro__ + ] + if enum_models_classes: + enum_file = Path(enum_models_classes[0][0]) + shutil.copyfile(enum_file, Path(output_folder, enum_file.name)) + enum_file_module_name = enum_file.with_suffix('').name + else: + enum_file_module_name = None + + write_model_file(Path(output_folder, "models_py3.py"), models_classes) + write_model_file(Path(output_folder, "models.py"), py2_models_classes) + write_paging_file(Path(output_folder, "paged_models.py"), paged_models_classes) + write_init( + Path(output_folder, "__init__.py"), + "models_py3", + "models", + "paged_models", + enum_file_module_name + ) + + +def write_model_file(output_file_path, classes_to_write): + with open(output_file_path, "bw") as write_fd: + write_fd.write(header) + + for model in classes_to_write: + _, model_file_path, _ = model + + with open(model_file_path, "rb") as read_fd: + lines = read_fd.readlines() + # Skip until it's "class XXXX" + while lines: + if lines[0].startswith(b"class "): + break + lines.pop(0) + else: + raise ValueError("Never found any class definition!") + # Now I keep everything + write_fd.write(b'\n') + write_fd.write(b'\n') + write_fd.writelines(lines) + + +def write_paging_file(output_file_path, classes_to_write): + with open(output_file_path, "bw") as write_fd: + write_fd.write(paging_header) + + for model in classes_to_write: + model_file_path, _ = model + + with open(model_file_path, "rb") as read_fd: + # Skip the first 15 lines (based on Autorest deterministic behavior) + # If we want this less random, look for the first line starts with "class" + lines = read_fd.readlines()[14:] + write_fd.write(b'\n') + write_fd.write(b'\n') + write_fd.writelines(lines) + + +def write_init(output_file_path, model_file_name, model_file_name_py2, paging_file_name, enum_file_name): + with open(output_file_path, "bw") as write_fd: + write_fd.write(copyright_header) + + write_fd.write(init_file.format( + model_file_name, + model_file_name_py2, + paging_file_name, + ).encode('utf8')) + if enum_file_name: + write_fd.write( + "from .{} import *".format(enum_file_name).encode('utf8') + ) + + +def find_models_to_change(module_name): + """Will figure out if the package is a multi-api one, + and understand what to generate. + """ + main_module = importlib.import_module(module_name) + try: + models_module = main_module.models + models_module.__path__ + # It didn't fail, that's a single API package + return [models_module] + except AttributeError: + # This means I loaded the fake module "models" + # and it's multi-api, load all models + return [ + importlib.import_module('.' + label + '.models', main_module.__name__) + for (_, label, ispkg) in pkgutil.iter_modules(main_module.__path__) + if ispkg + ] + + +def find_autorest_generated_folder(module_prefix="azure.mgmt"): + """Find all Autorest generated code in that module prefix. + + This actually looks for a "models" package only. We could be smarter if necessary. + """ + _LOGGER.info("Looking for Autorest generated package in %s", module_prefix) + result = [] + prefix_module = importlib.import_module(module_prefix) + for _, sub_package, ispkg in pkgutil.iter_modules(prefix_module.__path__, module_prefix + "."): + try: + _LOGGER.debug("Try %s", sub_package) + importlib.import_module(".models", sub_package) + # If not exception, we found it + _LOGGER.info("Found %s", sub_package) + result.append(sub_package) + except ModuleNotFoundError: + # No model, might dig deeper + if ispkg: + result += find_autorest_generated_folder(sub_package) + return result + + +if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) + + prefix = sys.argv[1] if len(sys.argv) >= 2 else "azure.mgmt" + for autorest_package in find_autorest_generated_folder(prefix): + models = find_models_to_change(autorest_package) + solve_mro(models) diff --git a/src/command_modules/azure-cli-ams/HISTORY.rst b/src/command_modules/azure-cli-ams/HISTORY.rst index 63d38d21b28..891e698ec7f 100644 --- a/src/command_modules/azure-cli-ams/HISTORY.rst +++ b/src/command_modules/azure-cli-ams/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.3 ++++++ +* Minor fixes + 0.2.2 +++++ * Minor changes diff --git a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/_exception_handler.py b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/_exception_handler.py index 3d6e832a554..fa14a0ed231 100644 --- a/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/_exception_handler.py +++ b/src/command_modules/azure-cli-ams/azure/cli/command_modules/ams/_exception_handler.py @@ -5,7 +5,7 @@ def ams_exception_handler(ex): - from azure.mgmt.media.models.api_error import ApiErrorException + from azure.mgmt.media.models import ApiErrorException from knack.util import CLIError if isinstance(ex, ApiErrorException) \ diff --git a/src/command_modules/azure-cli-ams/setup.py b/src/command_modules/azure-cli-ams/setup.py index 64d74d78c4a..233f025d689 100644 --- a/src/command_modules/azure-cli-ams/setup.py +++ b/src/command_modules/azure-cli-ams/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.2" +VERSION = "0.2.3" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-batch/HISTORY.rst b/src/command_modules/azure-cli-batch/HISTORY.rst index b58e862e1cc..c11a160c33a 100644 --- a/src/command_modules/azure-cli-batch/HISTORY.rst +++ b/src/command_modules/azure-cli-batch/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +3.3.3 ++++++ +* Minor fixes + 3.3.2 +++++ * Update Key Vault SDK dependency diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py index 53bce1209a5..688b227f9c2 100644 --- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py +++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py @@ -7,8 +7,7 @@ from knack.arguments import CLIArgumentType -from azure.mgmt.batch.models.batch_management_client_enums import \ - (AccountKeyType) +from azure.mgmt.batch.models import AccountKeyType from azure.batch.models.batch_service_client_enums import \ (ComputeNodeDeallocationOption) diff --git a/src/command_modules/azure-cli-batch/setup.py b/src/command_modules/azure-cli-batch/setup.py index 707df484244..9299eaa6bc1 100644 --- a/src/command_modules/azure-cli-batch/setup.py +++ b/src/command_modules/azure-cli-batch/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "3.3.2" +VERSION = "3.3.3" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-cosmosdb/HISTORY.rst b/src/command_modules/azure-cli-cosmosdb/HISTORY.rst index a89b8b4ba30..2e57c641586 100644 --- a/src/command_modules/azure-cli-cosmosdb/HISTORY.rst +++ b/src/command_modules/azure-cli-cosmosdb/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.1 ++++++ +* Minor fixes + 0.2.0 +++++ * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. diff --git a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_params.py b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_params.py index a4ad2dfe246..19c62ce962f 100644 --- a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_params.py +++ b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_params.py @@ -17,7 +17,7 @@ def load_arguments(self, _): - from azure.mgmt.cosmosdb.models.cosmos_db_enums import KeyKind, DefaultConsistencyLevel, DatabaseAccountKind + from azure.mgmt.cosmosdb.models import KeyKind, DefaultConsistencyLevel, DatabaseAccountKind with self.argument_context('cosmosdb') as c: c.argument('account_name', arg_type=name_type, help='Name of the Cosmos DB database account', completer=get_resource_name_completion_list('Microsoft.DocumentDb/databaseAccounts'), id_part='name') diff --git a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_validators.py b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_validators.py index 757e0ea4c8e..6260e120418 100644 --- a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_validators.py +++ b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/_validators.py @@ -6,7 +6,7 @@ def validate_failover_policies(ns): """ Extracts multiple space-separated failoverPolicies in regionName=failoverPriority format """ - from azure.mgmt.cosmosdb.models.failover_policy import FailoverPolicy + from azure.mgmt.cosmosdb.models import FailoverPolicy fp_dict = [] for item in ns.failover_policies: comps = item.split('=', 1) @@ -16,7 +16,7 @@ def validate_failover_policies(ns): def validate_locations(ns): """ Extracts multiple space-separated locations in regionName=failoverPriority format """ - from azure.mgmt.cosmosdb.models.location import Location + from azure.mgmt.cosmosdb.models import Location if ns.locations is None: ns.locations = [] return @@ -34,7 +34,7 @@ def validate_ip_range_filter(ns): def validate_capabilities(ns): """ Extracts multiple space-separated capabilities """ - from azure.mgmt.cosmosdb.models.capability import Capability + from azure.mgmt.cosmosdb.models import Capability if ns.capabilities is not None: capabilties_list = [] for item in ns.capabilities: @@ -44,7 +44,7 @@ def validate_capabilities(ns): def validate_virtual_network_rules(ns): """ Extracts multiple space-separated virtual network rules """ - from azure.mgmt.cosmosdb.models.virtual_network_rule import VirtualNetworkRule + from azure.mgmt.cosmosdb.models import VirtualNetworkRule if ns.virtual_network_rules is not None: virtual_network_rules_list = [] for item in ns.virtual_network_rules: diff --git a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/custom.py b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/custom.py index db394d1b45b..5df8fd82efe 100644 --- a/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/custom.py +++ b/src/command_modules/azure-cli-cosmosdb/azure/cli/command_modules/cosmosdb/custom.py @@ -9,14 +9,12 @@ from azure.mgmt.cosmosdb.models import ( ConsistencyPolicy, DatabaseAccountCreateUpdateParameters, - Location + Location, + DatabaseAccountKind ) -from azure.mgmt.cosmosdb.models.cosmos_db_enums import DatabaseAccountKind - logger = get_logger(__name__) - DEFAULT_INDEXING_POLICY = """{ "indexingMode": "consistent", "automatic": true, @@ -108,13 +106,13 @@ def cli_cosmosdb_update(client, # pylint: disable=too-many-boolean-expressions if capabilities is not None: if locations or \ - default_consistency_level is not None or \ - max_staleness_prefix is not None or \ - max_interval is not None or \ - ip_range_filter is not None or \ - enable_automatic_failover is not None or \ - enable_virtual_network is not None or \ - virtual_network_rules is not None: + default_consistency_level is not None or \ + max_staleness_prefix is not None or \ + max_interval is not None or \ + ip_range_filter is not None or \ + enable_automatic_failover is not None or \ + enable_virtual_network is not None or \ + virtual_network_rules is not None: raise CLIError("Cannot set capabilities and update properties at the same time. {0}".format(locations)) else: @@ -126,15 +124,14 @@ def cli_cosmosdb_update(client, # Workaround until PATCH support for all properties # pylint: disable=too-many-boolean-expressions if tags is not None: - if not locations and\ - default_consistency_level is None and\ - max_staleness_prefix is None and\ - max_interval is None and\ - ip_range_filter is None and\ - enable_automatic_failover is None and\ - enable_virtual_network is None and\ - virtual_network_rules is None: - + if not locations and \ + default_consistency_level is None and \ + max_staleness_prefix is None and \ + max_interval is None and \ + ip_range_filter is None and \ + enable_automatic_failover is None and \ + enable_virtual_network is None and \ + virtual_network_rules is None: async_docdb_create = client.patch(resource_group_name, account_name, tags=tags, capabilities=capabilities) docdb_account = async_docdb_create.result() docdb_account = client.get(resource_group_name, account_name) @@ -142,8 +139,8 @@ def cli_cosmosdb_update(client, update_consistency_policy = False if max_interval is not None or \ - max_staleness_prefix is not None or \ - default_consistency_level is not None: + max_staleness_prefix is not None or \ + default_consistency_level is not None: update_consistency_policy = True if max_staleness_prefix is None: diff --git a/src/command_modules/azure-cli-cosmosdb/setup.py b/src/command_modules/azure-cli-cosmosdb/setup.py index fca80b79510..ef5e99de6a6 100644 --- a/src/command_modules/azure-cli-cosmosdb/setup.py +++ b/src/command_modules/azure-cli-cosmosdb/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.2.0" +VERSION = "0.2.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-dla/HISTORY.rst b/src/command_modules/azure-cli-dla/HISTORY.rst index 8d00d89535b..7bd3cff7c18 100644 --- a/src/command_modules/azure-cli-dla/HISTORY.rst +++ b/src/command_modules/azure-cli-dla/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.2 ++++++ +* Minor fixes + 0.2.1 +++++ * Minor fixes diff --git a/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/_params.py b/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/_params.py index 73a1db8bf2f..2c815687337 100644 --- a/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/_params.py +++ b/src/command_modules/azure-cli-dla/azure/cli/command_modules/dla/_params.py @@ -14,12 +14,10 @@ # pylint: disable=line-too-long, too-many-statements def load_arguments(self, _): + from azure.mgmt.datalake.analytics.account.models import (FirewallState, TierType, FirewallAllowAzureIpsState, + AADObjectType) - from azure.mgmt.datalake.analytics.account.models.data_lake_analytics_account_management_client_enums import ( - FirewallState, TierType, FirewallAllowAzureIpsState, AADObjectType) - - from azure.mgmt.datalake.analytics.job.models.data_lake_analytics_job_management_client_enums import ( - CompileMode, JobState, JobResult) + from azure.mgmt.datalake.analytics.job.models import (CompileMode, JobState, JobResult) datalake_analytics_name_type = CLIArgumentType(help='Name of the Data Lake Analytics account.', options_list=('--account_name',), completer=get_resource_name_completion_list('Microsoft.DataLakeAnalytics/accounts'), id_part='name') diff --git a/src/command_modules/azure-cli-dla/setup.py b/src/command_modules/azure-cli-dla/setup.py index 688b5f57681..3cf2426880d 100644 --- a/src/command_modules/azure-cli-dla/setup.py +++ b/src/command_modules/azure-cli-dla/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.2.1" +VERSION = "0.2.2" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-dls/HISTORY.rst b/src/command_modules/azure-cli-dls/HISTORY.rst index a9822494e26..b03b9c647e4 100644 --- a/src/command_modules/azure-cli-dls/HISTORY.rst +++ b/src/command_modules/azure-cli-dls/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.1.1 ++++++ +* Minor fixes + 0.1.0 ++++++ * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. diff --git a/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/_params.py b/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/_params.py index 8acbccae1da..0793e648af4 100644 --- a/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/_params.py +++ b/src/command_modules/azure-cli-dls/azure/cli/command_modules/dls/_params.py @@ -9,7 +9,7 @@ tags_type, get_resource_name_completion_list, resource_group_name_type, get_enum_type) from azure.cli.command_modules.dls._validators import validate_resource_group_name -from azure.mgmt.datalake.store.models.data_lake_store_account_management_client_enums import ( +from azure.mgmt.datalake.store.models import ( FirewallState, TrustedIdProviderState, TierType, diff --git a/src/command_modules/azure-cli-dls/setup.py b/src/command_modules/azure-cli-dls/setup.py index 10ac72607d7..7c0e37dcf4c 100644 --- a/src/command_modules/azure-cli-dls/setup.py +++ b/src/command_modules/azure-cli-dls/setup.py @@ -16,7 +16,7 @@ cmdclass = {} -VERSION = "0.1.0" +VERSION = "0.1.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-eventhubs/HISTORY.rst b/src/command_modules/azure-cli-eventhubs/HISTORY.rst index b73f2071dfd..935f514f52d 100644 --- a/src/command_modules/azure-cli-eventhubs/HISTORY.rst +++ b/src/command_modules/azure-cli-eventhubs/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.3 ++++++ +* Minor fixes + 0.2.2 +++++ * added readonly property 'pendingReplicationOperationsCount' to georecovery-alias diff --git a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_params.py b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_params.py index 10891b848b8..321e924d420 100644 --- a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_params.py +++ b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_params.py @@ -12,7 +12,7 @@ # pylint: disable=line-too-long def load_arguments_eh(self, _): from knack.arguments import CLIArgumentType - from azure.mgmt.eventhub.models.event_hub_management_client_enums import KeyType, AccessRights, SkuName + from azure.mgmt.eventhub.models import KeyType, AccessRights, SkuName from azure.cli.command_modules.eventhubs._completers import get_consumergroup_command_completion_list, get_eventhubs_command_completion_list from azure.cli.command_modules.eventhubs._validator import validate_storageaccount, validate_partner_namespace diff --git a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_utils.py b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_utils.py index 8a3e538549a..3cee31455f9 100644 --- a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_utils.py +++ b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/_utils.py @@ -5,7 +5,7 @@ def accessrights_converter(accessrights): - from azure.mgmt.eventhub.models.event_hub_management_client_enums import AccessRights + from azure.mgmt.eventhub.models import AccessRights accessrights_new = [] if 'Send' in accessrights: accessrights_new.append(AccessRights.send) diff --git a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/custom.py b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/custom.py index d4949dbe362..1df61d9a3d2 100644 --- a/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/custom.py +++ b/src/command_modules/azure-cli-eventhubs/azure/cli/command_modules/eventhubs/custom.py @@ -60,8 +60,7 @@ def cli_autho_update(instance, rights): # Eventhub Region def cli_eheventhub_create(client, resource_group_name, namespace_name, event_hub_name, message_retention_in_days=None, partition_count=None, status=None, enabled=None, capture_interval_seconds=None, capture_size_limit_bytes=None, destination_name=None, storage_account_resource_id=None, blob_container=None, archive_name_format=None): - from azure.mgmt.eventhub.models import Eventhub, CaptureDescription, Destination - from azure.mgmt.eventhub.models.event_hub_management_client_enums import EncodingCaptureDescription + from azure.mgmt.eventhub.models import Eventhub, CaptureDescription, Destination, EncodingCaptureDescription eventhubparameter1 = Eventhub() if message_retention_in_days: eventhubparameter1.message_retention_in_days = message_retention_in_days diff --git a/src/command_modules/azure-cli-eventhubs/setup.py b/src/command_modules/azure-cli-eventhubs/setup.py index 7c0b062e960..5434ad0a363 100644 --- a/src/command_modules/azure-cli-eventhubs/setup.py +++ b/src/command_modules/azure-cli-eventhubs/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.2" +VERSION = "0.2.3" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py b/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py index 59918b5a85a..d9e76a04df5 100644 --- a/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py +++ b/src/command_modules/azure-cli-iot/azure/cli/command_modules/iot/_params.py @@ -11,10 +11,10 @@ get_resource_name_completion_list, get_enum_type, get_three_state_flag) -from azure.mgmt.iothub.models.iot_hub_client_enums import IotHubSku -from azure.mgmt.iothubprovisioningservices.models.iot_dps_client_enums import (IotDpsSku, - AllocationPolicy, - AccessRightsDescription) +from azure.mgmt.iothub.models import IotHubSku +from azure.mgmt.iothubprovisioningservices.models import (IotDpsSku, + AllocationPolicy, + AccessRightsDescription) from .custom import KeyType, SimpleAccessRights from ._validators import validate_policy_permissions diff --git a/src/command_modules/azure-cli-iotcentral/HISTORY.rst b/src/command_modules/azure-cli-iotcentral/HISTORY.rst index 0498e4f776b..9620f2d6d1e 100644 --- a/src/command_modules/azure-cli-iotcentral/HISTORY.rst +++ b/src/command_modules/azure-cli-iotcentral/HISTORY.rst @@ -3,7 +3,10 @@ Release History =============== -0.1.0 +0.1.1 +++++ +* Minor fixes +0.1.0 ++++++ * Initial release of IoT Central module. diff --git a/src/command_modules/azure-cli-iotcentral/azure/cli/command_modules/iotcentral/_params.py b/src/command_modules/azure-cli-iotcentral/azure/cli/command_modules/iotcentral/_params.py index 435f2637a27..d0ded6b1cae 100644 --- a/src/command_modules/azure-cli-iotcentral/azure/cli/command_modules/iotcentral/_params.py +++ b/src/command_modules/azure-cli-iotcentral/azure/cli/command_modules/iotcentral/_params.py @@ -5,7 +5,7 @@ # pylint: disable=line-too-long from knack.arguments import CLIArgumentType -from azure.mgmt.iotcentral.models.iot_central_client_enums import AppSku +from azure.mgmt.iotcentral.models import AppSku from azure.cli.core.commands.parameters import (get_location_type, get_resource_name_completion_list, diff --git a/src/command_modules/azure-cli-iotcentral/setup.py b/src/command_modules/azure-cli-iotcentral/setup.py index 66c53147afd..7582d5aade6 100644 --- a/src/command_modules/azure-cli-iotcentral/setup.py +++ b/src/command_modules/azure-cli-iotcentral/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.0" +VERSION = "0.1.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/_params.py b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/_params.py index 0570adb956f..cf69941f932 100644 --- a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/_params.py +++ b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/_params.py @@ -55,7 +55,7 @@ def load_arguments(self, _): c.argument('name', options_list=['--name', '-n']) with self.argument_context('lab secret') as c: - from azure.mgmt.devtestlabs.models.secret import Secret + from azure.mgmt.devtestlabs.models import Secret c.argument('name', options_list=['--name', '-n']) c.argument('secret', options_list=['--value'], type=lambda x: Secret(value=x)) diff --git a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/custom.py b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/custom.py index 0205b76f59a..f12ea49ad92 100644 --- a/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/custom.py +++ b/src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/custom.py @@ -37,8 +37,7 @@ def create_lab_vm(client, resource_group_name, lab_name, name, notes=None, image disk_type=None, expiration_date=None, formula=None, ip_configuration=None, network_interface=None, os_type=None, saved_secret=None): """ Command to create vm of in the Azure DevTest Lab """ - from azure.mgmt.devtestlabs.models.lab_virtual_machine_creation_parameter import \ - LabVirtualMachineCreationParameter + from azure.mgmt.devtestlabs.models import LabVirtualMachineCreationParameter is_ssh_authentication = authentication_type == 'ssh' @@ -89,9 +88,7 @@ def create_environment(client, resource_group_name, lab_name, name, arm_template artifact_source_name=None, user_name="@me", tags=None): """ Command to create an environment the Azure DevTest Lab """ - from azure.mgmt.devtestlabs.models.environment_deployment_properties \ - import EnvironmentDeploymentProperties - from azure.mgmt.devtestlabs.models.dtl_environment import DtlEnvironment + from azure.mgmt.devtestlabs.models import EnvironmentDeploymentProperties, DtlEnvironment environment_deployment_properties = EnvironmentDeploymentProperties(arm_template, parameters) dtl_environment = DtlEnvironment(tags=tags, diff --git a/src/command_modules/azure-cli-maps/HISTORY.rst b/src/command_modules/azure-cli-maps/HISTORY.rst index 47b72a27bcc..4ce7d393cd6 100644 --- a/src/command_modules/azure-cli-maps/HISTORY.rst +++ b/src/command_modules/azure-cli-maps/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.2 ++++++ +* Minor fixes + 0.3.1 +++++ * Minor fixes. diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py index 61e6d3f9651..e8be429a257 100644 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/_params.py @@ -11,7 +11,7 @@ resource_group_name_type, tags_type) -from azure.mgmt.maps.models.maps_management_client_enums import KeyType +from azure.mgmt.maps.models import KeyType def load_arguments(self, _): diff --git a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py index d6bd6b591af..71e63ecbeb4 100644 --- a/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py +++ b/src/command_modules/azure-cli-maps/azure/cli/command_modules/maps/tests/latest/test_maps_commands.py @@ -6,7 +6,7 @@ import re from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from azure.mgmt.maps.models.maps_management_client_enums import KeyType +from azure.mgmt.maps.models import KeyType class MapsScenarioTests(ScenarioTest): diff --git a/src/command_modules/azure-cli-maps/setup.py b/src/command_modules/azure-cli-maps/setup.py index 77c1e2cc841..e409bd2ca3c 100644 --- a/src/command_modules/azure-cli-maps/setup.py +++ b/src/command_modules/azure-cli-maps/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.3.1" +VERSION = "0.3.2" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-monitor/HISTORY.rst b/src/command_modules/azure-cli-monitor/HISTORY.rst index 4be0eb74475..eaebe9a5ca1 100644 --- a/src/command_modules/azure-cli-monitor/HISTORY.rst +++ b/src/command_modules/azure-cli-monitor/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.3 ++++++ +* Minor fixes + 0.2.2 +++++ * Minor fixes diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_params.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_params.py index 4af510a9319..728d03fb39b 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_params.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/_params.py @@ -22,7 +22,7 @@ # pylint: disable=line-too-long, too-many-statements def load_arguments(self, _): - from azure.mgmt.monitor.models.monitor_management_client_enums import ConditionOperator, TimeAggregationOperator + from azure.mgmt.monitor.models import ConditionOperator, TimeAggregationOperator name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME') webhook_prop_type = CLIArgumentType(validator=process_webhook_prop, nargs='*') @@ -93,7 +93,7 @@ def load_arguments(self, _): with self.argument_context('monitor metrics list') as c: from .validators import (process_metric_timespan, process_metric_aggregation, process_metric_result_type, process_metric_dimension, validate_metric_names) - from azure.mgmt.monitor.models.monitor_management_client_enums import AggregationType + from azure.mgmt.monitor.models import AggregationType c.resource_parameter('resource_uri', arg_group='Target Resource') c.extra('start_time', options_list=['--start-time'], validator=process_metric_timespan, arg_group='Time') c.extra('end_time', options_list=['--end-time'], arg_group='Time') diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/activity_log_alerts.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/activity_log_alerts.py index cfa26661a60..4a60a74076d 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/activity_log_alerts.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/activity_log_alerts.py @@ -212,7 +212,7 @@ def _normalize_names(cli_ctx, resource_names, resource_group, namespace, resourc def _get_alert_settings(client, resource_group_name, activity_log_alert_name, throw_if_missing=True): - from azure.mgmt.monitor.models.error_response import ErrorResponseException + from azure.mgmt.monitor.models import ErrorResponseException try: return client.get(resource_group_name=resource_group_name, activity_log_alert_name=activity_log_alert_name) diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/diagnostics_settings.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/diagnostics_settings.py index 2fbeafece13..f6f73b59c8f 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/diagnostics_settings.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/diagnostics_settings.py @@ -12,7 +12,7 @@ def create_diagnostics_settings(client, name, resource_uri, event_hub_rule=None, storage_account=None, workspace=None): - from azure.mgmt.monitor.models.diagnostic_settings_resource import DiagnosticSettingsResource + from azure.mgmt.monitor.models import DiagnosticSettingsResource parameters = DiagnosticSettingsResource(storage_account_id=storage_account, workspace_id=workspace, diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/log_profiles.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/log_profiles.py index dea9731b81f..66f3e93579e 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/log_profiles.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/operations/log_profiles.py @@ -6,8 +6,7 @@ def create_log_profile_operations(client, name, location, locations, categories, days, enabled, tags=None, storage_account_id=None, service_bus_rule_id=None): - from azure.mgmt.monitor.models.log_profile_resource import LogProfileResource - from azure.mgmt.monitor.models import RetentionPolicy + from azure.mgmt.monitor.models import RetentionPolicy, LogProfileResource parameters = LogProfileResource(location=location, locations=locations, categories=categories, retention_policy=RetentionPolicy(days=days, enabled=enabled), storage_account_id=storage_account_id, service_bus_rule_id=service_bus_rule_id, diff --git a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py index 3c6e09b041f..b1d5f0994ea 100644 --- a/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py +++ b/src/command_modules/azure-cli-monitor/azure/cli/command_modules/monitor/validators.py @@ -231,7 +231,7 @@ def process_metric_aggregation(namespace): def process_metric_result_type(namespace): - from azure.mgmt.monitor.models.monitor_management_client_enums import ResultType + from azure.mgmt.monitor.models import ResultType ns = vars(namespace) metadata_only = ns.pop('metadata', False) diff --git a/src/command_modules/azure-cli-monitor/setup.py b/src/command_modules/azure-cli-monitor/setup.py index 1d3c670e71e..e518dcce9d6 100644 --- a/src/command_modules/azure-cli-monitor/setup.py +++ b/src/command_modules/azure-cli-monitor/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.2" +VERSION = "0.2.3" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', diff --git a/src/command_modules/azure-cli-redis/HISTORY.rst b/src/command_modules/azure-cli-redis/HISTORY.rst index f01784b1547..aee397d1b6b 100644 --- a/src/command_modules/azure-cli-redis/HISTORY.rst +++ b/src/command_modules/azure-cli-redis/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.1 ++++++ +* Minor fixes + 0.3.0 +++++ * BREAKING CHANGE: 'show' commands log error message and fail with exit code of 3 upon a missing resource. diff --git a/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/_params.py b/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/_params.py index 9c2eb7197ce..a1a8a5c9f9a 100644 --- a/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/_params.py +++ b/src/command_modules/azure-cli-redis/azure/cli/command_modules/redis/_params.py @@ -9,7 +9,7 @@ import azure.cli.command_modules.redis._help # pylint: disable=unused-import from azure.cli.command_modules.redis._validators import JsonString, ScheduleEntryList -from azure.mgmt.redis.models.redis_management_client_enums import RebootType, RedisKeyType, SkuName +from azure.mgmt.redis.models import RebootType, RedisKeyType, SkuName from azure.cli.core.commands.parameters import get_enum_type # TODO: Move this into Knack diff --git a/src/command_modules/azure-cli-redis/setup.py b/src/command_modules/azure-cli-redis/setup.py index c6543fa2b05..70199c6f0ae 100644 --- a/src/command_modules/azure-cli-redis/setup.py +++ b/src/command_modules/azure-cli-redis/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.3.0" +VERSION = "0.3.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-relay/HISTORY.rst b/src/command_modules/azure-cli-relay/HISTORY.rst index 990ac454e76..c2654348e9f 100644 --- a/src/command_modules/azure-cli-relay/HISTORY.rst +++ b/src/command_modules/azure-cli-relay/HISTORY.rst @@ -3,9 +3,10 @@ Release History =============== +0.1.1 ++++++ +* Minor fixes 0.1.0 +++++ - * Initial release. - diff --git a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_params.py b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_params.py index b2c5bb78e6a..977cd56175c 100644 --- a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_params.py +++ b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_params.py @@ -14,7 +14,7 @@ def load_arguments_sb(self, _): get_hyco_command_completion_list from knack.arguments import CLIArgumentType - from azure.mgmt.relay.models.relay_management_client_enums import SkuTier, AccessRights, KeyType + from azure.mgmt.relay.models import SkuTier, AccessRights, KeyType rights_arg_type = CLIArgumentType(options_list=['--rights'], nargs='+', arg_type=get_enum_type(AccessRights), help='Space-separated list of Authorization rule rights') key_arg_type = CLIArgumentType(options_list=['--key'], arg_type=get_enum_type(KeyType), help='specifies Primary or Secondary key needs to be reset') keyvalue_arg_type = CLIArgumentType(options_list=['--key-value'], help='Optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType.') diff --git a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_utils.py b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_utils.py index 3ad5035e184..a697f8a004e 100644 --- a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_utils.py +++ b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/_utils.py @@ -5,7 +5,7 @@ def accessrights_converter(accessrights): - from azure.mgmt.relay.models.relay_management_client_enums import AccessRights + from azure.mgmt.relay.models import AccessRights accessrights_new = [] if 'Send' in accessrights: accessrights_new.append(AccessRights.send) diff --git a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/custom.py b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/custom.py index 6da4dea64ed..78d225decc3 100644 --- a/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/custom.py +++ b/src/command_modules/azure-cli-relay/azure/cli/command_modules/relay/custom.py @@ -18,7 +18,6 @@ def cli_namespace_create(client, resource_group_name, namespace_name, location=N parameters=RelayNamespace( location, tags) - ) diff --git a/src/command_modules/azure-cli-relay/setup.py b/src/command_modules/azure-cli-relay/setup.py index aa13532561a..157a7f5b892 100644 --- a/src/command_modules/azure-cli-relay/setup.py +++ b/src/command_modules/azure-cli-relay/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.1.0" +VERSION = "0.1.1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers diff --git a/src/command_modules/azure-cli-reservations/HISTORY.rst b/src/command_modules/azure-cli-reservations/HISTORY.rst index 63167641059..01d6cb6ebdf 100644 --- a/src/command_modules/azure-cli-reservations/HISTORY.rst +++ b/src/command_modules/azure-cli-reservations/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.3.2 ++++++ +* Minor fixes + 0.3.1 +++++ * Minor fixes. diff --git a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/_params.py b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/_params.py index cba2d2a88d2..44b9414eb40 100644 --- a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/_params.py +++ b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/_params.py @@ -8,7 +8,7 @@ from azure.cli.core.commands.parameters import get_enum_type -from azure.mgmt.reservations.models.azure_reservation_api_enums import ( +from azure.mgmt.reservations.models import ( ReservedResourceType, InstanceFlexibility, AppliedScopeType diff --git a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/custom.py b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/custom.py index 90d317002c5..05efa9fbdac 100644 --- a/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/custom.py +++ b/src/command_modules/azure-cli-reservations/azure/cli/command_modules/reservations/custom.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from azure.mgmt.reservations.models.patch import Patch +from azure.mgmt.reservations.models import Patch def cli_reservation_update_reservation(client, reservation_order_id, reservation_id, diff --git a/src/command_modules/azure-cli-reservations/setup.py b/src/command_modules/azure-cli-reservations/setup.py index cdfa2fd65bf..894b3060bff 100644 --- a/src/command_modules/azure-cli-reservations/setup.py +++ b/src/command_modules/azure-cli-reservations/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.3.1" +VERSION = "0.3.2" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ diff --git a/src/command_modules/azure-cli-servicebus/HISTORY.rst b/src/command_modules/azure-cli-servicebus/HISTORY.rst index 7aef742559f..2a2a45b506f 100644 --- a/src/command_modules/azure-cli-servicebus/HISTORY.rst +++ b/src/command_modules/azure-cli-servicebus/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +0.2.2 ++++++ +* Minor fixes + 0.2.1 +++++ * Added migration command group to migrate a namespace from Service Bus Standard to Premium diff --git a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_params.py b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_params.py index 3757fbc8c38..3fbb9d029e9 100644 --- a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_params.py +++ b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_params.py @@ -18,7 +18,7 @@ def load_arguments_sb(self, _): _validate_lock_duration, validate_partner_namespace, validate_premiumsku_capacity, validate_target_namespace from knack.arguments import CLIArgumentType - from azure.mgmt.servicebus.models.service_bus_management_client_enums import SkuName, AccessRights, KeyType, FilterType + from azure.mgmt.servicebus.models import SkuName, AccessRights, KeyType, FilterType rights_arg_type = CLIArgumentType(options_list=['--rights'], nargs='+', arg_type=get_enum_type(AccessRights), help='Space-separated list of Authorization rule rights') key_arg_type = CLIArgumentType(options_list=['--key'], arg_type=get_enum_type(KeyType), help='specifies Primary or Secondary key needs to be reset') keyvalue_arg_type = CLIArgumentType(options_list=['--key-value'], help='Optional, if the key value provided, is set for KeyType or autogenerated Key value set for keyType.') diff --git a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_utils.py b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_utils.py index 08b9e230174..becd551d792 100644 --- a/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_utils.py +++ b/src/command_modules/azure-cli-servicebus/azure/cli/command_modules/servicebus/_utils.py @@ -5,7 +5,7 @@ def accessrights_converter(accessrights): - from azure.mgmt.servicebus.models.service_bus_management_client_enums import AccessRights + from azure.mgmt.servicebus.models import AccessRights accessrights_new = [] if 'Send' in accessrights: accessrights_new.append(AccessRights.send) diff --git a/src/command_modules/azure-cli-servicebus/setup.py b/src/command_modules/azure-cli-servicebus/setup.py index ab2cb5d675a..edf927d3aee 100644 --- a/src/command_modules/azure-cli-servicebus/setup.py +++ b/src/command_modules/azure-cli-servicebus/setup.py @@ -13,7 +13,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "0.2.1" +VERSION = "0.2.2" # The full list of classifiers is available at diff --git a/src/command_modules/azure-cli-sql/HISTORY.rst b/src/command_modules/azure-cli-sql/HISTORY.rst index 3f4bce24dd8..271396a7ced 100644 --- a/src/command_modules/azure-cli-sql/HISTORY.rst +++ b/src/command_modules/azure-cli-sql/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +2.1.3 ++++++ +* Minor fixes + 2.1.2 ++++++ * Minor fixes. diff --git a/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/_params.py b/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/_params.py index 23d62f3d7aa..befdd1258bf 100644 --- a/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/_params.py +++ b/src/command_modules/azure-cli-sql/azure/cli/command_modules/sql/_params.py @@ -20,10 +20,7 @@ ManagedInstance, Server, ServerAzureADAdministrator, - Sku -) - -from azure.mgmt.sql.models.sql_management_client_enums import ( + Sku, AuthenticationType, BlobAuditingPolicyState, CatalogCollationType, diff --git a/src/command_modules/azure-cli-sql/setup.py b/src/command_modules/azure-cli-sql/setup.py index da0df8e404d..eaed2d856e6 100644 --- a/src/command_modules/azure-cli-sql/setup.py +++ b/src/command_modules/azure-cli-sql/setup.py @@ -12,7 +12,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.1.2" +VERSION = "2.1.3" CLASSIFIERS = [ 'Development Status :: 4 - Beta',