commit azure-cli-core for openSUSE:Factory
Hello community, here is the log from the commit of package azure-cli-core for openSUSE:Factory checked in at 2019-12-02 11:27:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-core (Old) and /work/SRC/openSUSE:Factory/.azure-cli-core.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "azure-cli-core" Mon Dec 2 11:27:36 2019 rev:8 rq:751656 version:2.0.77 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-core/azure-cli-core.changes 2019-10-31 18:15:43.554039745 +0100 +++ /work/SRC/openSUSE:Factory/.azure-cli-core.new.4691/azure-cli-core.changes 2019-12-02 11:29:19.770615985 +0100 @@ -1,0 +2,9 @@ +Thu Nov 28 14:47:20 UTC 2019 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com> + +- New upstream release + + Version 2.0.77 + + For detailed information about changes see the + HISTORY.txt file provided with this package +- Update Requires from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-core-2.0.75.tar.gz New: ---- azure-cli-core-2.0.77.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-core.spec ++++++ --- /var/tmp/diff_new_pack.zET1y7/_old 2019-12-02 11:29:20.618615593 +0100 +++ /var/tmp/diff_new_pack.zET1y7/_new 2019-12-02 11:29:20.618615593 +0100 @@ -1,7 +1,7 @@ # # spec file for package azure-cli-core # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,12 +17,12 @@ Name: azure-cli-core -Version: 2.0.75 +Version: 2.0.77 Release: 0 Summary: Microsoft Azure CLI Core Module License: MIT Group: System/Management -Url: https://github.com/Azure/azure-cli +URL: https://github.com/Azure/azure-cli Source: https://files.pythonhosted.org/packages/source/a/azure-cli-core/azure-cli-core-%{version}.tar.gz Source1: LICENSE.txt BuildRequires: azure-cli-nspkg @@ -54,7 +54,8 @@ Requires: python3-pip Requires: python3-pyOpenSSL >= 17.1.0 Requires: python3-requests >= 2.20.0 -Requires: python3-six +Requires: python3-six < 2.0.0 +Requires: python3-six >= 1.12 Requires: python3-wheel >= 0.30.0 %if %{python3_version_nodots} < 34 Requires: python-enum34 >= 1.0.4 ++++++ azure-cli-core-2.0.75.tar.gz -> azure-cli-core-2.0.77.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/HISTORY.rst new/azure-cli-core-2.0.77/HISTORY.rst --- old/azure-cli-core-2.0.75/HISTORY.rst 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/HISTORY.rst 2019-11-22 06:26:37.000000000 +0100 @@ -3,9 +3,19 @@ Release History =============== +2.0.77 +++++++ +* Add deprecate message for Python 2.7 +* Refine the help and error messages for `--ids` + +2.0.76 +++++++ +* no changes + 2.0.75 ++++++ * Add syntax check for --set parameter in generic update command. +* Fix #10760: `az login` fails if subscription name is None * Minor change in DeploymentOutputLongRunningOperation 2.0.74 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/PKG-INFO new/azure-cli-core-2.0.77/PKG-INFO --- old/azure-cli-core-2.0.75/PKG-INFO 2019-10-11 10:59:57.000000000 +0200 +++ new/azure-cli-core-2.0.77/PKG-INFO 2019-11-22 06:26:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-cli-core -Version: 2.0.75 +Version: 2.0.77 Summary: Microsoft Azure Command-Line Tools Core Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation @@ -15,9 +15,19 @@ Release History =============== + 2.0.77 + ++++++ + * Add deprecate message for Python 2.7 + * Refine the help and error messages for `--ids` + + 2.0.76 + ++++++ + * no changes + 2.0.75 ++++++ * Add syntax check for --set parameter in generic update command. + * Fix #10760: `az login` fails if subscription name is None * Minor change in DeploymentOutputLongRunningOperation 2.0.74 @@ -475,5 +485,6 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: License :: OSI Approved :: MIT License Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/__init__.py new/azure-cli-core-2.0.77/azure/cli/core/__init__.py --- old/azure-cli-core-2.0.75/azure/cli/core/__init__.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/__init__.py 2019-11-22 06:26:37.000000000 +0100 @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from __future__ import print_function -__version__ = "2.0.75" +__version__ = "2.0.77" import os import sys @@ -90,7 +90,9 @@ if updates_available == -1: logger.warning('Unable to check if your CLI is up-to-date. Check your internet connection.') elif updates_available: - logger.warning('You have %i updates available. Consider updating your CLI installation.', updates_available) + logger.warning('You have %i updates available. Consider updating your CLI installation. ' + 'Instructions can be found at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli', + updates_available) else: print('Your CLI is up-to-date.') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/_help.py new/azure-cli-core-2.0.77/azure/cli/core/_help.py --- old/azure-cli-core-2.0.75/azure/cli/core/_help.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/_help.py 2019-11-22 06:26:37.000000000 +0100 @@ -74,6 +74,7 @@ @staticmethod def _print_examples(help_file): + from colorama import Style indent = 0 _print_indent('Examples', indent) for e in help_file.examples: @@ -84,6 +85,9 @@ _print_indent(u'{0}'.format(e.long_summary), indent) _print_indent(u'{0}'.format(e.command), indent) print('') + indent = 0 + message = 'For more specific examples, use: az find "az {}"'.format(help_file.command) + _print_indent(Style.BRIGHT + message + Style.RESET_ALL + '\n', indent) @staticmethod def _process_value_sources(p): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/_profile.py new/azure-cli-core-2.0.77/azure/cli/core/_profile.py --- old/azure-cli-core-2.0.75/azure/cli/core/_profile.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/_profile.py 2019-11-22 06:26:37.000000000 +0100 @@ -18,7 +18,8 @@ from azure.cli.core._environment import get_config_dir from azure.cli.core._session import ACCOUNT -from azure.cli.core.util import get_file_json, in_cloud_console, open_page_in_browser, can_launch_browser +from azure.cli.core.util import get_file_json, in_cloud_console, open_page_in_browser, can_launch_browser,\ + is_windows, is_wsl from azure.cli.core.cloud import get_active_cloud, set_cloud_subscription from knack.log import get_logger @@ -209,7 +210,7 @@ if not allow_no_subscriptions and not subscriptions: raise CLIError("No subscriptions were found for '{}'. If this is expected, use " - "'--allow-no-subscriptions' to have tenant level accesses".format( + "'--allow-no-subscriptions' to have tenant level access".format( username)) if is_service_principal: @@ -222,7 +223,8 @@ t_list = [s.tenant_id for s in subscriptions] bare_tenants = [t for t in subscription_finder.tenants if t not in t_list] profile = Profile(cli_ctx=self.cli_ctx) - subscriptions = profile._build_tenant_level_accounts(bare_tenants) # pylint: disable=protected-access + tenant_accounts = profile._build_tenant_level_accounts(bare_tenants) # pylint: disable=protected-access + subscriptions.extend(tenant_accounts) if not subscriptions: return [] @@ -239,8 +241,10 @@ consolidated = [] for s in subscriptions: display_name = s.display_name + if display_name is None: + display_name = '' try: - s.display_name.encode(sys.getdefaultencoding()) + display_name.encode(sys.getdefaultencoding()) except (UnicodeEncodeError, UnicodeDecodeError): # mainly for Python 2.7 with ascii as the default encoding display_name = re.sub(r'[^\x00-\x7f]', lambda x: '?', display_name) @@ -339,13 +343,12 @@ if allow_no_subscriptions: subscriptions = self._build_tenant_level_accounts([tenant]) else: - raise CLIError('No access was configured for the VM, hence no subscriptions were found') + raise CLIError('No access was configured for the VM, hence no subscriptions were found. ' + "If this is expected, use '--allow-no-subscriptions' to have tenant level access.") consolidated = self._normalize_properties(user, subscriptions, is_service_principal=True, user_assigned_identity_id=base_name) - - # key-off subscription name to allow accounts with same id(but under different identities) - self._set_subscriptions(consolidated, secondary_key_name=_SUBSCRIPTION_NAME) + self._set_subscriptions(consolidated) return deepcopy(consolidated) def find_subscriptions_in_cloud_console(self): @@ -1087,6 +1090,16 @@ import random reply_url = None + + # On Windows, HTTPServer by default doesn't throw error if the port is in-use + # https://github.com/Azure/azure-cli/issues/10578 + if is_windows(): + logger.debug('Windows is detected. Set HTTPServer.allow_reuse_address to False') + ClientRedirectServer.allow_reuse_address = False + elif is_wsl(): + logger.debug('WSL is detected. Set HTTPServer.allow_reuse_address to False') + ClientRedirectServer.allow_reuse_address = False + for port in range(8400, 9000): try: web_server = ClientRedirectServer(('localhost', port), ClientRedirectHandler) @@ -1115,10 +1128,6 @@ results['no_browser'] = True return - # emit a warning for transitioning to the new experience - logger.warning('Note, we have launched a browser for you to login. For old experience' - ' with device code, use "az login --use-device-code"') - # wait for callback from browser. while True: web_server.handle_request() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/_session.py new/azure-cli-core-2.0.77/azure/cli/core/_session.py --- old/azure-cli-core-2.0.75/azure/cli/core/_session.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/_session.py 2019-11-22 06:26:37.000000000 +0100 @@ -43,7 +43,7 @@ try: if max_age > 0: st = os.stat(self.filename) - if st.st_mtime + max_age < time.clock(): + if st.st_mtime + max_age < time.time(): self.save() with codecs_open(self.filename, 'r', encoding=self._encoding) as f: self.data = json.load(f) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/adal_authentication.py new/azure-cli-core-2.0.77/azure/cli/core/adal_authentication.py --- old/azure-cli-core-2.0.75/azure/cli/core/adal_authentication.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/adal_authentication.py 2019-11-22 06:26:37.000000000 +0100 @@ -49,6 +49,9 @@ if not in_cloud_console() else '')) raise CLIError(err) + except requests.exceptions.SSLError as err: + from .util import SSLERROR_TEMPLATE + raise CLIError(SSLERROR_TEMPLATE.format(str(err))) except requests.exceptions.ConnectionError as err: raise CLIError('Please ensure you have network connection. Error detail: ' + str(err)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/cloud.py new/azure-cli-core-2.0.77/azure/cli/core/cloud.py --- old/azure-cli-core-2.0.75/azure/cli/core/cloud.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/cloud.py 2019-11-22 06:26:37.000000000 +0100 @@ -4,11 +4,13 @@ # -------------------------------------------------------------------------------------------- import os +import json from pprint import pformat from six.moves import configparser from azure.cli.core.profiles import API_PROFILES from azure.cli.core._config import GLOBAL_CONFIG_DIR +from azure.cli.core.util import urlretrieve from knack.log import get_logger from knack.util import CLIError @@ -127,6 +129,59 @@ return val +def _get_ossrdbms_resource_id(cloud_name): + ossrdbms_mapper = { + 'AzureCloud': 'https://ossrdbms-aad.database.windows.net', + 'AzureChinaCloud': 'https://ossrdbms-aad.database.chinacloudapi.cn', + 'AzureUSGovernment': 'https://ossrdbms-aad.database.usgovcloudapi.net', + 'AzureGermanCloud': 'https://ossrdbms-aad.database.cloudapi.de' + } + return ossrdbms_mapper.get(cloud_name, None) + + +def _get_microsoft_graph_resource_id(cloud_name): + graph_endpoint_mapper = { + 'AzureCloud': 'https://graph.microsoft.com/', + 'AzureChinaCloud': 'https://microsoftgraph.chinacloudapi.cn/', + 'AzureUSGovernment': 'https://graph.microsoft.us/', + 'AzureGermanCloud': 'https://graph.microsoft.de/' + } + return graph_endpoint_mapper.get(cloud_name, None) + + +def _convert_arm_to_cli(arm_cloud_metadata_dict): + cli_cloud_metadata_dict = {} + for cloud in arm_cloud_metadata_dict: + cli_cloud_metadata_dict[cloud['name']] = _arm_to_cli_mapper(cloud) + return cli_cloud_metadata_dict + + +def _arm_to_cli_mapper(arm_dict): + return Cloud( + arm_dict['name'], + endpoints=CloudEndpoints( + management=arm_dict['authentication']['audiences'][0], + resource_manager=arm_dict['resourceManager'], + sql_management=arm_dict['sqlManagement'], + batch_resource_id=arm_dict['batch'], + gallery=arm_dict['gallery'], + active_directory=arm_dict['authentication']['loginEndpoint'], + active_directory_resource_id=arm_dict['authentication']['audiences'][0], + active_directory_graph_resource_id=arm_dict['graphAudience'], + microsoft_graph_resource_id=_get_microsoft_graph_resource_id(arm_dict['name']), # pylint: disable=line-too-long # change once microsoft_graph_resource_id is fixed in ARM + vm_image_alias_doc=arm_dict['vmImageAliasDoc'], # pylint: disable=line-too-long + media_resource_id=arm_dict['media'], + ossrdbms_resource_id=_get_ossrdbms_resource_id(arm_dict['name']), # pylint: disable=line-too-long # change once ossrdbms_resource_id is available via ARM + active_directory_data_lake_resource_id=arm_dict['activeDirectoryDataLake'] if 'activeDirectoryDataLake' in arm_dict else None), # pylint: disable=line-too-long + suffixes=CloudSuffixes( + storage_endpoint=arm_dict['suffixes']['storage'], + keyvault_dns=arm_dict['suffixes']['keyVaultDns'], + sql_server_hostname=arm_dict['suffixes']['sqlServerHostname'], + azure_datalake_store_file_system_endpoint=arm_dict['suffixes']['azureDataLakeStoreFileSystem'] if 'azureDataLakeStoreFileSystem' in arm_dict['suffixes'] else None, # pylint: disable=line-too-long + azure_datalake_analytics_catalog_and_job_endpoint=arm_dict['suffixes']['azureDataLakeAnalyticsCatalogAndJob'] if 'azureDataLakeAnalyticsCatalogAndJob' in arm_dict['suffixes'] else None, # pylint: disable=line-too-long + acr_login_server_endpoint=arm_dict['suffixes']['acrLoginServer'] if 'acrLoginServer' in arm_dict['suffixes'] else None)) # pylint: disable=line-too-long + + class Cloud(object): # pylint: disable=too-few-public-methods """ Represents an Azure Cloud instance """ @@ -239,9 +294,19 @@ keyvault_dns='.vault.microsoftazure.de', sql_server_hostname='.database.cloudapi.de')) - KNOWN_CLOUDS = [AZURE_PUBLIC_CLOUD, AZURE_CHINA_CLOUD, AZURE_US_GOV_CLOUD, AZURE_GERMAN_CLOUD] +if 'ARM_CLOUD_METADATA_URL' in os.environ: + try: + arm_cloud_dict = json.loads(urlretrieve(os.getenv('ARM_CLOUD_METADATA_URL'))) + cli_cloud_dict = _convert_arm_to_cli(arm_cloud_dict) + if 'AzureCloud' in cli_cloud_dict: + cli_cloud_dict['AzureCloud'].endpoints.active_directory = 'https://login.microsoftonline.com' # pylint: disable=line-too-long # change once active_directory is fixed in ARM for the public cloud + KNOWN_CLOUDS = list(cli_cloud_dict.values()) + except Exception as ex: # pylint: disable=broad-except + logger.warning('Failed to load cloud metadata from the url specified by ARM_CLOUD_METADATA_URL') + raise ex + def _set_active_cloud(cli_ctx, cloud_name): cli_ctx.config.set_value('cloud', 'name', cloud_name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/commands/__init__.py new/azure-cli-core-2.0.77/azure/cli/core/commands/__init__.py --- old/azure-cli-core-2.0.75/azure/cli/core/commands/__init__.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/commands/__init__.py 2019-11-22 06:26:37.000000000 +0100 @@ -92,7 +92,7 @@ try: return _load_file(poss_file) except IOError: - logger.debug("Failed to load @'%s', assume not a file", arg) + logger.debug("Failed to load '%s', assume not a file", arg) return arg # if @ not at the start it can't be a file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/commands/arm.py new/azure-cli-core-2.0.77/azure/cli/core/commands/arm.py --- old/azure-cli-core-2.0.75/azure/cli/core/commands/arm.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/commands/arm.py 2019-11-22 06:26:37.000000000 +0100 @@ -218,8 +218,9 @@ deprecate_info = id_arg.settings.get('deprecate_info', None) if id_arg else None id_kwargs = { 'metavar': 'ID', - 'help': "One or more resource IDs (space-delimited). If provided, " - "no other 'Resource Id' arguments should be specified.", + 'help': "One or more resource IDs (space-delimited). " + "It should be a complete resource ID containing all information of '{gname}' arguments. " + "If provided, no other '{gname}' arguments should be specified.".format(gname=group_name), 'dest': 'ids' if id_arg else '_ids', 'deprecate_info': deprecate_info, 'is_preview': id_arg.settings.get('is_preview', None) if id_arg else None, @@ -309,7 +310,17 @@ # place the ID parts into the correct property lists parts = parse_resource_id(val) for arg in combined_args: - getattr(namespace, arg.name).append(parts[arg.type.settings['id_part']]) + id_part = arg.type.settings.get('id_part') + id_value = parts.get(id_part, None) + if id_value is None: + argument_name = arg.type.settings.get('options_list')[0] + raise CLIError("Argument {arg_name} cannot be derived from ID {id}. " + "Please provide a complete resource ID " + "containing all information of '{group_name}' " + "arguments. ".format(id=val, + arg_name=argument_name, + group_name=arg.arg_group)) + getattr(namespace, arg.name).append(id_value) # support deprecating --ids deprecate_info = cmd.arguments['ids'].type.settings.get('deprecate_info') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/commands/template_create.py new/azure-cli-core-2.0.77/azure/cli/core/commands/template_create.py --- old/azure-cli-core-2.0.75/azure/cli/core/commands/template_create.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/commands/template_create.py 2019-11-22 06:26:37.000000000 +0100 @@ -42,7 +42,10 @@ # add parent name option string (if applicable) if other_required_option: - help_text = '{} If name specified, also specify {}'.format(help_text, other_required_option) + help_text = '{} If name specified, also specify {}.'.format(help_text, other_required_option) + help_text = '{} If you want to use an existing {display_name} in other resource group or subscription, ' \ + 'please provide the ID instead of the name of the {display_name}'.format(help_text, + display_name=display_name) return help_text diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/profiles/_shared.py new/azure-cli-core-2.0.77/azure/cli/core/profiles/_shared.py --- old/azure-cli-core-2.0.75/azure/cli/core/profiles/_shared.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/profiles/_shared.py 2019-11-22 06:26:37.000000000 +0100 @@ -47,6 +47,7 @@ MGMT_RESOURCE_POLICY = ('azure.mgmt.resource.policy', 'PolicyClient') MGMT_RESOURCE_RESOURCES = ('azure.mgmt.resource.resources', 'ResourceManagementClient') MGMT_RESOURCE_SUBSCRIPTIONS = ('azure.mgmt.resource.subscriptions', 'SubscriptionClient') + MGMT_MONITOR = ('azure.mgmt.monitor', 'MonitorManagementClient') DATA_KEYVAULT = ('azure.keyvault', 'KeyVaultClient') MGMT_EVENTHUB = ('azure.mgmt.eventhub', 'EventHubManagementClient') # the "None" below will stay till a command module fills in the type so "get_mgmt_service_client" @@ -76,7 +77,6 @@ MGMT_IOTCENTRAL = ('azure.mgmt.iotcentral', None) MGMT_DEVTESTLABS = ('azure.mgmt.devtestlabs', None) MGMT_MAPS = ('azure.mgmt.maps', None) - MGMT_MONITOR = ('azure.mgmt.monitor', None) MGMT_POLICYINSIGHTS = ('azure.mgmt.policyinsights', None) MGMT_RDBMS = ('azure.mgmt.rdbms', None) MGMT_REDIS = ('azure.mgmt.redis', None) @@ -124,18 +124,18 @@ AZURE_API_PROFILES = { 'latest': { ResourceType.MGMT_STORAGE: '2019-04-01', - ResourceType.MGMT_NETWORK: '2019-04-01', - ResourceType.MGMT_COMPUTE: SDKProfile('2019-03-01', { + ResourceType.MGMT_NETWORK: '2019-09-01', + ResourceType.MGMT_COMPUTE: SDKProfile('2019-07-01', { 'resource_skus': '2019-04-01', - 'disks': '2019-03-01', - 'snapshots': '2019-03-01', + 'disks': '2019-07-01', + 'snapshots': '2019-07-01', 'galleries': '2019-07-01' }), ResourceType.MGMT_RESOURCE_FEATURES: '2015-12-01', ResourceType.MGMT_RESOURCE_LINKS: '2016-09-01', ResourceType.MGMT_RESOURCE_LOCKS: '2016-09-01', ResourceType.MGMT_RESOURCE_POLICY: '2019-06-01', - ResourceType.MGMT_RESOURCE_RESOURCES: '2019-05-10', + ResourceType.MGMT_RESOURCE_RESOURCES: '2019-07-01', ResourceType.MGMT_RESOURCE_SUBSCRIPTIONS: '2016-06-01', ResourceType.MGMT_NETWORK_DNS: '2018-05-01', ResourceType.MGMT_KEYVAULT: '2018-02-14', @@ -148,7 +148,33 @@ ResourceType.DATA_KEYVAULT: '7.0', ResourceType.DATA_STORAGE: '2018-11-09', ResourceType.DATA_COSMOS_TABLE: '2017-04-17', - ResourceType.MGMT_EVENTHUB: '2017-04-01' + ResourceType.MGMT_EVENTHUB: '2017-04-01', + ResourceType.MGMT_MONITOR: SDKProfile('2019-06-01', { + 'activity_log_alerts': '2017-04-01', + 'activity_logs': '2015-04-01', + 'alert_rule_incidents': '2016-03-01', + 'alert_rules': '2016-03-01', + 'autoscale_settings': '2015-04-01', + 'baseline': '2018-09-01', + 'baselines': '2019-03-01', + 'diagnostic_settings': '2017-05-01-preview', + 'diagnostic_settings_category': '2017-05-01-preview', + 'event_categories': '2015-04-01', + 'guest_diagnostics_settings': '2018-06-01-preview', + 'guest_diagnostics_settings_association': '2018-06-01-preview', + 'log_profiles': '2016-03-01', + 'metric_alerts': '2018-03-01', + 'metric_alerts_status': '2018-03-01', + 'metric_baseline': '2018-09-01', + 'metric_definitions': '2018-01-01', + 'metric_namespaces': '2017-12-01-preview', + 'metrics': '2018-01-01', + 'operations': '2015-04-01', + 'scheduled_query_rules': '2018-04-16', + 'service_diagnostic_settings': '2016-09-01', + 'tenant_activity_logs': '2015-04-01', + 'vm_insights': '2018-11-27-preview' + }) }, '2019-03-01-hybrid': { ResourceType.MGMT_STORAGE: '2017-10-01', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure/cli/core/util.py new/azure-cli-core-2.0.77/azure/cli/core/util.py --- old/azure-cli-core-2.0.75/azure/cli/core/util.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure/cli/core/util.py 2019-11-22 06:26:37.000000000 +0100 @@ -9,16 +9,26 @@ import getpass import base64 import binascii +import platform +import ssl import six +from six.moves.urllib.request import urlopen # pylint: disable=import-error from knack.log import get_logger from knack.util import CLIError, to_snake_case +from azure.common import AzureException logger = get_logger(__name__) CLI_PACKAGE_NAME = 'azure-cli' COMPONENT_PREFIX = 'azure-cli-' +SSLERROR_TEMPLATE = ('Certificate verification failed. This typically happens when using Azure CLI behind a proxy ' + 'that intercepts traffic with a self-signed certificate. ' + # pylint: disable=line-too-long + 'Please add this certificate to the trusted CA bundle: https://github.com/Azure/azure-cli/blob/dev/doc/use_cli_effectively.md#worki.... ' + 'Error detail: {}') + def handle_exception(ex): # pylint: disable=too-many-return-statements # For error code, follow guidelines at https://docs.python.org/2/library/sys.html#sys.exit, @@ -33,14 +43,18 @@ logger.error("To learn more about --query, please visit: " "https://docs.microsoft.com/cli/azure/query-azure-cli?view=azure-cli-latest") return 1 - if isinstance(ex, (CLIError, CloudError)): + if isinstance(ex, (CLIError, CloudError, AzureException)): logger.error(ex.args[0]) return ex.args[1] if len(ex.args) >= 2 else 1 if isinstance(ex, ValidationError): logger.error('validation error: %s', ex) return 1 if isinstance(ex, ClientRequestError): - logger.error("request failed: %s", ex) + msg = str(ex) + if 'SSLError' in msg: + logger.error("request failed: %s", SSLERROR_TEMPLATE.format(msg)) + else: + logger.error("request failed: %s", ex) return 1 if isinstance(ex, KeyboardInterrupt): return 1 @@ -119,7 +133,6 @@ def get_az_version_string(): - import platform from azure.cli.core.extension import get_extensions, EXTENSIONS_DIR, DEV_EXTENSION_SOURCES output = six.StringIO() @@ -179,6 +192,9 @@ _print() _print('Legal docs and information: aka.ms/AzureCliLegal') _print() + if sys.version.startswith('2.7'): + _print("* DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. \nA future version of Azure CLI will drop support for Python 2.7.") + _print() version_string = output.getvalue() # if unable to query PyPI, use sentinel value to flag that @@ -357,9 +373,9 @@ def open_page_in_browser(url): import subprocess import webbrowser - platform_name, release = _get_platform_info() + platform_name, _ = _get_platform_info() - if _is_wsl(platform_name, release): # windows 10 linux subsystem + if is_wsl(): # windows 10 linux subsystem try: return subprocess.call(['cmd.exe', '/c', "start {}".format(url.replace('&', '^&'))]) except OSError: # WSL might be too old # FileNotFoundError introduced in Python 3 @@ -377,7 +393,6 @@ def _get_platform_info(): - import platform uname = platform.uname() # python 2, `platform.uname()` returns: tuple(system, node, release, version, machine, processor) platform_name = getattr(uname, 'system', None) or uname[0] @@ -385,16 +400,21 @@ return platform_name.lower(), release.lower() -def _is_wsl(platform_name, release): +def is_wsl(): platform_name, release = _get_platform_info() return platform_name == 'linux' and release.split('-')[-1] == 'microsoft' +def is_windows(): + platform_name, _ = _get_platform_info() + return platform_name == 'windows' + + def can_launch_browser(): import os import webbrowser - platform_name, release = _get_platform_info() - if _is_wsl(platform_name, release) or platform_name != 'linux': + platform_name, _ = _get_platform_info() + if is_wsl() or platform_name != 'linux': return True # per https://unix.stackexchange.com/questions/46305/is-there-a-way-to-retrieve-th... # and https://unix.stackexchange.com/questions/193827/what-is-display-0 @@ -601,3 +621,18 @@ def __exit__(self, exc_type, exc_val, exc_tb): setattr(self.cli_config, 'use_local_config', self.original_use_local_config) + + +def _ssl_context(): + if sys.version_info < (3, 4) or (in_cloud_console() and platform.system() == 'Windows'): + try: + return ssl.SSLContext(ssl.PROTOCOL_TLS) # added in python 2.7.13 and 3.6 + except AttributeError: + return ssl.SSLContext(ssl.PROTOCOL_TLSv1) + + return ssl.create_default_context() + + +def urlretrieve(url): + req = urlopen(url, context=_ssl_context()) + return req.read() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure_cli_core.egg-info/PKG-INFO new/azure-cli-core-2.0.77/azure_cli_core.egg-info/PKG-INFO --- old/azure-cli-core-2.0.75/azure_cli_core.egg-info/PKG-INFO 2019-10-11 10:59:57.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure_cli_core.egg-info/PKG-INFO 2019-11-22 06:26:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-cli-core -Version: 2.0.75 +Version: 2.0.77 Summary: Microsoft Azure Command-Line Tools Core Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation @@ -15,9 +15,19 @@ Release History =============== + 2.0.77 + ++++++ + * Add deprecate message for Python 2.7 + * Refine the help and error messages for `--ids` + + 2.0.76 + ++++++ + * no changes + 2.0.75 ++++++ * Add syntax check for --set parameter in generic update command. + * Fix #10760: `az login` fails if subscription name is None * Minor change in DeploymentOutputLongRunningOperation 2.0.74 @@ -475,5 +485,6 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: License :: OSI Approved :: MIT License Provides-Extra: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/azure_cli_core.egg-info/requires.txt new/azure-cli-core-2.0.77/azure_cli_core.egg-info/requires.txt --- old/azure-cli-core-2.0.75/azure_cli_core.egg-info/requires.txt 2019-10-11 10:59:57.000000000 +0200 +++ new/azure-cli-core-2.0.77/azure_cli_core.egg-info/requires.txt 2019-11-22 06:26:47.000000000 +0100 @@ -12,7 +12,7 @@ pyopenssl>=17.1.0 pyyaml requests~=2.20 -six +six~=1.12 wheel==0.30.0 azure-mgmt-resource~=4.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.0.75/setup.py new/azure-cli-core-2.0.77/setup.py --- old/azure-cli-core-2.0.75/setup.py 2019-10-11 10:59:52.000000000 +0200 +++ new/azure-cli-core-2.0.77/setup.py 2019-11-22 06:26:37.000000000 +0100 @@ -17,7 +17,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.0.75" +VERSION = "2.0.77" # If we have source, validate that our version numbers match # This should prevent uploading releases with mismatched versions. try: @@ -49,6 +49,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ] @@ -67,7 +68,7 @@ 'pyopenssl>=17.1.0', # https://github.com/pyca/pyopenssl/pull/612 'pyyaml', 'requests~=2.20', - 'six', + 'six~=1.12', 'wheel==0.30.0', 'azure-mgmt-resource~=4.0', ]
participants (1)
-
root