diff --git a/src/support/HISTORY.md b/src/support/HISTORY.md index 1bfe288bf6e..03bbcb5dc31 100644 --- a/src/support/HISTORY.md +++ b/src/support/HISTORY.md @@ -1,6 +1,17 @@ Release History =============== +1.0.1 +----- +* Remove resource id existence check in liue of backend based check + +1.0.0 +----- + +* GA release of "support" extension for Azure CLI. +* Command `update` under command group `tickets` supports new parameter `status`. +* `Severity` parameter used by command `update` and `create` under command group `tickets` supports an additional value `highestcriticalimpact`. + 0.1.1 ----- @@ -11,11 +22,3 @@ Release History * Initial release of "support" extension for Azure CLI. * Adding two major command groups, `az support services` and `az support tickets` to manage support ticket and related resources. - -1.0.0 ------ - -* GA release of "support" extension for Azure CLI. -* Command `update` under command group `tickets` supports new parameter `status`. -* `Severity` parameter used by command `update` and `create` under command group `tickets` supports an additional value `highestcriticalimpact`. - diff --git a/src/support/azext_support/_client_factory.py b/src/support/azext_support/_client_factory.py index ca6b38e7207..a98a40d7013 100644 --- a/src/support/azext_support/_client_factory.py +++ b/src/support/azext_support/_client_factory.py @@ -25,9 +25,3 @@ def cf_support_tickets(cli_ctx, *_): def cf_communications(cli_ctx, *_): return cf_support(cli_ctx).communications - - -def cf_resource(cli_ctx, **_): - from azure.cli.core.commands.client_factory import get_mgmt_service_client - from azure.cli.core.profiles import ResourceType - return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES) diff --git a/src/support/azext_support/_validators.py b/src/support/azext_support/_validators.py index af6af762a86..b0804518ba1 100644 --- a/src/support/azext_support/_validators.py +++ b/src/support/azext_support/_validators.py @@ -3,16 +3,14 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import traceback import uuid from datetime import datetime -from azext_support._client_factory import cf_resource, cf_support_tickets, cf_communications +from azext_support._client_factory import cf_support_tickets, cf_communications from azext_support._utils import is_technical_ticket, parse_support_area_path from azure.cli.core.commands.client_factory import get_subscription_id from knack.log import get_logger from knack.util import CLIError -from msrestazure.azure_exceptions import CloudError from msrestazure.tools import is_valid_resource_id, parse_resource_id logger = get_logger(__name__) @@ -68,7 +66,7 @@ def _validate_problem_classification_name(problem_classification_id): def _validate_resource_name(cmd, resource_id): if resource_id is None: return - client = cf_resource(cmd.cli_ctx) + base_error_msg = "Technical resource argument {0} is invalid.".format(resource_id) if not is_valid_resource_id(resource_id): raise CLIError(base_error_msg) @@ -82,17 +80,6 @@ def _validate_resource_name(cmd, resource_id): if subid != session_subid: raise CLIError("{0} {1} does not match with {2}".format(base_error_msg, subid, session_subid)) - try: - client.resources.get(resource_group_name=parsed_resource['resource_group'], - resource_provider_namespace=parsed_resource["namespace"], - parent_resource_path=parsed_resource["resource_parent"], - resource_type=parsed_resource["type"], - resource_name=parsed_resource["name"], - api_version="2019-08-01") - except CloudError as e: - logger.debug(traceback.format_exc()) - raise CLIError("{0} {1}".format(base_error_msg, e.error.message)) - def _is_guid(guid): try: diff --git a/src/support/setup.py b/src/support/setup.py index 8a06534a02a..f692652ee7e 100644 --- a/src/support/setup.py +++ b/src/support/setup.py @@ -15,7 +15,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") # HISTORY.md entry. -VERSION = '1.0.0' +VERSION = '1.0.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers