Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package azure-cli-core for openSUSE:Factory checked in at 2022-10-19 13:17:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/azure-cli-core (Old) and /work/SRC/openSUSE:Factory/.azure-cli-core.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-core" Wed Oct 19 13:17:23 2022 rev:44 rq:1010599 version:2.41.0 Changes: -------- --- /work/SRC/openSUSE:Factory/azure-cli-core/azure-cli-core.changes 2022-09-20 19:23:33.794470527 +0200 +++ /work/SRC/openSUSE:Factory/.azure-cli-core.new.2275/azure-cli-core.changes 2022-10-19 13:17:46.261233793 +0200 @@ -1,0 +2,9 @@ +Thu Oct 13 08:09:02 UTC 2022 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- New upstream release + + Version 2.41.0 + + For detailed information about changes see the + HISTORY.rst file provided with this package +- Update Requires from setup.py + +------------------------------------------------------------------- Old: ---- azure-cli-core-2.40.0.tar.gz New: ---- azure-cli-core-2.41.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ azure-cli-core.spec ++++++ --- /var/tmp/diff_new_pack.gGwgrt/_old 2022-10-19 13:17:47.865237118 +0200 +++ /var/tmp/diff_new_pack.gGwgrt/_new 2022-10-19 13:17:47.869237126 +0200 @@ -17,7 +17,7 @@ Name: azure-cli-core -Version: 2.40.0 +Version: 2.41.0 Release: 0 Summary: Microsoft Azure CLI Core Module License: MIT @@ -47,7 +47,7 @@ Requires: python3-knack < 1.0.0 Requires: python3-knack >= 0.10.0 Requires: python3-msal < 2.0.0 -Requires: python3-msal >= 1.18.0b1 +Requires: python3-msal >= 1.20.0 Requires: python3-msal-extensions < 2.0.0 Requires: python3-msal-extensions >= 1.0.0 Requires: python3-msrestazure < 0.7.0 ++++++ azure-cli-core-2.40.0.tar.gz -> azure-cli-core-2.41.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/HISTORY.rst new/azure-cli-core-2.41.0/HISTORY.rst --- old/azure-cli-core-2.40.0/HISTORY.rst 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/HISTORY.rst 2022-10-10 05:01:41.000000000 +0200 @@ -3,6 +3,16 @@ Release History =============== +2.41.0 +++++++ +* Support Continuous Access Evaluation (#23635) +* `aaz`: Support `yaml` file as value for compound arguments (#23817) +* PREVIEW: Support Web Account Manager (WAM) login on Windows. To opt in, run `az config set core.allow_broker=true` (#23828) +* `aaz`: Fix recursion depth exceeded for to_serialized_data of AAZObject (#23930) +* `aaz`: Support customized life cycle callback functions for `AAZCommand` (#23949) +* `aaz`: Fix two AAZObjects or AAZDicts comparison (#24035) +* Revert #23514: Rename entry script `az.ps1` to `azps.ps1` (#24015) + 2.40.0 ++++++ * `aaz`: Support using `cli_ctx` to initiate AAZCommand class (#23459) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/PKG-INFO new/azure-cli-core-2.41.0/PKG-INFO --- old/azure-cli-core-2.40.0/PKG-INFO 2022-09-02 07:40:15.802124500 +0200 +++ new/azure-cli-core-2.41.0/PKG-INFO 2022-10-10 05:01:57.753471900 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-cli-core -Version: 2.40.0 +Version: 2.41.0 Summary: Microsoft Azure Command-Line Tools Core Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation @@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: License :: OSI Approved :: MIT License -Requires-Python: >=3.6.0 +Requires-Python: >=3.7.0 License-File: LICENSE.txt Microsoft Azure CLI Core Module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/__init__.py new/azure-cli-core-2.41.0/azure/cli/core/__init__.py --- old/azure-cli-core-2.40.0/azure/cli/core/__init__.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/__init__.py 2022-10-10 05:01:41.000000000 +0200 @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long -__version__ = "2.40.0" +__version__ = "2.41.0" import os import sys diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/_profile.py new/azure-cli-core-2.41.0/azure/cli/core/_profile.py --- old/azure-cli-core-2.40.0/azure/cli/core/_profile.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/_profile.py 2022-10-10 05:01:41.000000000 +0200 @@ -766,7 +766,7 @@ # The tenant requires MFA and can't be accessed with home tenant's refresh token mfa_tenants.append(t) else: - logger.warning("Failed to authenticate '%s' due to error '%s'", t, ex) + logger.warning("Failed to authenticate %s due to error '%s'", t.tenant_id_name, ex) continue if not subscriptions: @@ -856,4 +856,8 @@ # EXPERIMENTAL: Use core.use_msal_http_cache=False to turn off MSAL HTTP cache. use_msal_http_cache = cli_ctx.config.getboolean('core', 'use_msal_http_cache', fallback=True) - return Identity(*args, encrypt=encrypt, use_msal_http_cache=use_msal_http_cache, **kwargs) + # PREVIEW: On Windows, use core.allow_broker=true to use broker (WAM) for authentication. + allow_broker = cli_ctx.config.getboolean('core', 'allow_broker', fallback=False) + + return Identity(*args, encrypt=encrypt, use_msal_http_cache=use_msal_http_cache, allow_broker=allow_broker, + **kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/aaz/__init__.py new/azure-cli-core-2.41.0/azure/cli/core/aaz/__init__.py --- old/azure-cli-core-2.40.0/azure/cli/core/aaz/__init__.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/aaz/__init__.py 2022-10-10 05:01:41.000000000 +0200 @@ -17,6 +17,6 @@ AAZSubscriptionIdArgFormat, AAZUuidFormat, AAZDateFormat, AAZTimeFormat, AAZDateTimeFormat, AAZDurationFormat from ._base import AAZValuePatch, AAZUndefined from ._command import AAZCommand, AAZWaitCommand, AAZCommandGroup, \ - register_command, register_command_group, load_aaz_command_table + register_callback, register_command, register_command_group, load_aaz_command_table from ._field_type import AAZIntType, AAZFloatType, AAZStrType, AAZBoolType, AAZDictType, AAZListType, AAZObjectType from ._operation import AAZHttpOperation, AAZJsonInstanceUpdateOperation, AAZGenericInstanceUpdateOperation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg_action.py new/azure-cli-core-2.41.0/azure/cli/core/aaz/_arg_action.py --- old/azure-cli-core-2.40.0/azure/cli/core/aaz/_arg_action.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/aaz/_arg_action.py 2022-10-10 05:01:41.000000000 +0200 @@ -167,7 +167,7 @@ @classmethod def _decode_value(cls, key, key_items, value): # pylint: disable=unused-argument from ._arg import AAZSimpleTypeArg - from azure.cli.core.util import get_file_json, shell_safe_json_parse + from azure.cli.core.util import get_file_json, shell_safe_json_parse, get_file_yaml schema = cls._schema for item in key_items: @@ -186,7 +186,12 @@ # read from file path = os.path.expanduser(value) if os.path.exists(path): - v = get_file_json(path, preserve_order=True) + if path.endswith('.yml') or path.endswith('.yaml'): + # read from yaml file + v = get_file_yaml(path) + else: + # read from json file + v = get_file_json(path, preserve_order=True) else: try: v = cls._str_parser(value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/aaz/_command.py new/azure-cli-core-2.41.0/azure/cli/core/aaz/_command.py --- old/azure-cli-core-2.40.0/azure/cli/core/aaz/_command.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/aaz/_command.py 2022-10-10 05:01:41.000000000 +0200 @@ -87,11 +87,21 @@ schema.generic_update_force_string = AAZGenericUpdateForceStringArg() return schema - def __init__(self, loader=None, cli_ctx=None, **kwargs): + def __init__(self, loader=None, cli_ctx=None, callbacks=None, **kwargs): """ :param loader: it is required for command registered in the command table :param cli_ctx: if a command instance is not registered in the command table, only cli_ctx is required. + :param callbacks: a dict of customized callback functions registered by @register_callback. + common used callbacks: + 'pre_operations': This callback runs before all the operations + pre_operations(ctx) -> void + 'post_operations': This callback runs after all the operations + post_operations(ctx) -> void + 'pre_instance_update': This callback runs before all the instance update operations + pre_instance_update(instance, ctx) -> void + 'post_instance_update': This callback runs after all the instance update operations and before PUT + post_instance_update(instance, ctx) -> void """ assert loader or cli_ctx, "loader or cli_ctx is required" self.loader = loader @@ -118,6 +128,7 @@ self.help = self.AZ_HELP self.ctx = None + self.callbacks = callbacks or {} # help property will be assigned as help_file for command parser: # https://github.com/Azure/azure-cli/blob/d69eedd89bd097306b8579476ef8026b9f2ad63d/src/azure-cli-core/azure/cli/core/parser.py#L104 @@ -242,6 +253,17 @@ ) +def register_callback(func): + def wrapper(self, *args, **kwargs): + callback = self.callbacks.get(func.__name__, None) + if callback is None: + return func(self, *args, **kwargs) + + kwargs.setdefault("ctx", self.ctx) + return callback(*args, **kwargs) + return wrapper + + def register_command_group( name, is_preview=False, is_experimental=False, hide=False, redirect=None, expiration=None): """This decorator is used to register an AAZCommandGroup as a cli command group. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/aaz/_field_value.py new/azure-cli-core-2.41.0/azure/cli/core/aaz/_field_value.py --- old/azure-cli-core-2.40.0/azure/cli/core/aaz/_field_value.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/aaz/_field_value.py 2022-10-10 05:01:41.000000000 +0200 @@ -101,9 +101,12 @@ def __eq__(self, other): if isinstance(other, AAZBaseValue): - other = other._data + return self._data == other._data + + # other is buld-in type value if other is None: return self._data is None + if (not isinstance(other, dict)) or len(other) != len(self._data): return False @@ -130,12 +133,13 @@ for schema in schemas: for name, field_schema in schema._fields.items(): - v = self[name].to_serialized_data(processor=processor, **kwargs) - if v == AAZUndefined: - continue - if field_schema._serialized_name: # pylint: disable=protected-access - name = field_schema._serialized_name # pylint: disable=protected-access - result[name] = v + if name in self._data: + v = self[name].to_serialized_data(processor=processor, **kwargs) + if v == AAZUndefined: + continue + if field_schema._serialized_name: # pylint: disable=protected-access + name = field_schema._serialized_name # pylint: disable=protected-access + result[name] = v if not result and self._is_patch: result = AAZUndefined @@ -194,7 +198,9 @@ def __eq__(self, other): if isinstance(other, AAZBaseValue): - other = other._data + return self._data == other._data + + # other is buld-in type value if other is None: return self._data is None @@ -322,6 +328,7 @@ if isinstance(other, AAZBaseValue): return self._data == other._data + # other is buld-in type value if other is None: return self._data is None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/aaz/_help.py new/azure-cli-core-2.41.0/azure/cli/core/aaz/_help.py --- old/azure-cli-core-2.40.0/azure/cli/core/aaz/_help.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/aaz/_help.py 2022-10-10 05:01:41.000000000 +0200 @@ -21,7 +21,7 @@ shorthand_help_messages = { "show-help": 'Try `??` to show more.', - "short-summary": 'Shorthand syntax supported.', + "short-summary": 'Support shorthand-syntax, json-file and yaml-file.', "long-summary": 'See https://github.com/Azure/azure-cli/tree/dev/doc/shorthand_syntax.md ' 'for more about shorthand syntax.' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/auth/identity.py new/azure-cli-core-2.41.0/azure/cli/core/auth/identity.py --- old/azure-cli-core-2.40.0/azure/cli/core/auth/identity.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/auth/identity.py 2022-10-10 05:01:41.000000000 +0200 @@ -53,7 +53,8 @@ # It follows singleton pattern so that _secret_file is read only once. _service_principal_store_instance = None - def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use_msal_http_cache=True): + def __init__(self, authority, tenant_id=None, client_id=None, encrypt=False, use_msal_http_cache=True, + allow_broker=None): """ :param authority: Authentication authority endpoint. For example, - AAD: https://login.microsoftonline.com @@ -68,6 +69,7 @@ self.client_id = client_id or AZURE_CLI_CLIENT_ID self._encrypt = encrypt self._use_msal_http_cache = use_msal_http_cache + self._allow_broker = allow_broker # Build the authority in MSAL style self._msal_authority, self._is_adfs = _get_authority_url(authority, tenant_id) @@ -95,7 +97,10 @@ return { "authority": self._msal_authority, "token_cache": Identity._msal_token_cache, - "http_cache": Identity._msal_http_cache + "http_cache": Identity._msal_http_cache, + "allow_broker": self._allow_broker, + # CP1 means we can handle claims challenges (CAE) + "client_capabilities": None if "AZURE_IDENTITY_DISABLE_CP1" in os.environ else ["CP1"] } @property @@ -130,9 +135,15 @@ def login_with_auth_code(self, scopes, **kwargs): # Emit a warning to inform that a browser is opened. # Only show the path part of the URL and hide the query string. - logger.warning("A web browser has been opened at %s. Please continue the login in the web browser. " - "If no web browser is available or if the web browser fails to open, use device code flow " - "with `az login --use-device-code`.", self._msal_app.authority.authorization_endpoint) + + def _prompt_launching_ui(ui=None, **_): + if ui == 'browser': + logger.warning("A web browser has been opened at %s. Please continue the login in the web browser. " + "If no web browser is available or if the web browser fails to open, use device code " + "flow with `az login --use-device-code`.", + self._msal_app.authority.authorization_endpoint) + elif ui == 'broker': + logger.warning("Please select the account you want to log in with.") from .util import read_response_templates success_template, error_template = read_response_templates() @@ -141,7 +152,9 @@ # on port 8400 from the old design. However, ADFS only allows port 8400. result = self._msal_app.acquire_token_interactive( scopes, prompt='select_account', port=8400 if self._is_adfs else None, - success_template=success_template, error_template=error_template, **kwargs) + success_template=success_template, error_template=error_template, + parent_window_handle=self._msal_app.CONSOLE_WINDOW_HANDLE, on_before_launching_ui=_prompt_launching_ui, + **kwargs) return check_result(result) def login_with_device_code(self, scopes, **kwargs): @@ -185,6 +198,12 @@ self._msal_app.remove_account(account) def logout_all_users(self): + # Remove users from MSAL + accounts = self._msal_app.get_accounts() + for account in accounts: + self._msal_app.remove_account(account) + + # Also remove token cache file for e in file_extensions.values(): _try_remove(self._token_cache_file + e) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/auth/msal_authentication.py new/azure-cli-core-2.41.0/azure/cli/core/auth/msal_authentication.py --- old/azure-cli-core-2.40.0/azure/cli/core/auth/msal_authentication.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/auth/msal_authentication.py 2022-10-10 05:01:41.000000000 +0200 @@ -53,16 +53,19 @@ self._account = accounts[0] - def get_token(self, *scopes, **kwargs): + def get_token(self, *scopes, claims=None, **kwargs): # scopes = ['https://pas.windows.net/CheckMyAccess/Linux/.default'] - logger.debug("UserCredential.get_token: scopes=%r, kwargs=%r", scopes, kwargs) + logger.debug("UserCredential.get_token: scopes=%r, claims=%r, kwargs=%r", scopes, claims, kwargs) - result = self.acquire_token_silent_with_error(list(scopes), self._account, **kwargs) + if claims: + logger.warning('Acquiring new access token silently for tenant %s with claims challenge: %s', + self.authority.tenant, claims) + result = self.acquire_token_silent_with_error(list(scopes), self._account, claims_challenge=claims, **kwargs) from azure.cli.core.azclierror import AuthenticationError try: # Check if an access token is returned. - check_result(result, scopes=scopes) + check_result(result, scopes=scopes, claims=claims) except AuthenticationError as ex: # For VM SSH ('data' is passed), if getting access token fails because # Conditional Access MFA step-up or compliance check is required, re-launch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/auth/util.py new/azure-cli-core-2.41.0/azure/cli/core/auth/util.py --- old/azure-cli-core-2.40.0/azure/cli/core/auth/util.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/auth/util.py 2022-10-10 05:01:41.000000000 +0200 @@ -37,19 +37,24 @@ # Cloud Shell uses IMDS-like interface for implicit login. If getting token/cert failed, # we let the user explicitly log in to AAD with MSAL. "Please explicitly log in with:\n{}" if error.get('error') == 'broker_error' - else "To re-authenticate, please run:\n{}").format(login_command) + else "Interactive authentication is needed. Please run:\n{}").format(login_command) from azure.cli.core.azclierror import AuthenticationError - raise AuthenticationError(error_description, recommendation=login_message) + raise AuthenticationError(error_description, msal_error=error, recommendation=login_message) -def _generate_login_command(scopes=None): +def _generate_login_command(scopes=None, claims=None): login_command = ['az login'] # Rejected by Conditional Access policy, like MFA if scopes: login_command.append('--scope {}'.format(' '.join(scopes))) + # Rejected by CAE + if claims: + # Explicit logout is needed: https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/335 + return 'az logout\n' + ' '.join(login_command) + return ' '.join(login_command) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/azclierror.py new/azure-cli-core-2.41.0/azure/cli/core/azclierror.py --- old/azure-cli-core-2.40.0/azure/cli/core/azclierror.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/azclierror.py 2022-10-10 05:01:41.000000000 +0200 @@ -266,6 +266,9 @@ class AuthenticationError(ServiceError): """ Raised when AAD authentication fails. """ + def __init__(self, error_msg, msal_error=None, **kwargs): + super().__init__(error_msg, **kwargs) + self.msal_error = msal_error class HTTPError(CLIError): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/commands/client_factory.py new/azure-cli-core-2.41.0/azure/cli/core/commands/client_factory.py --- old/azure-cli-core-2.40.0/azure/cli/core/commands/client_factory.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/commands/client_factory.py 2022-10-10 05:01:41.000000000 +0200 @@ -168,11 +168,11 @@ client_kwargs = _prepare_client_kwargs_track2(cli_ctx) # Enable CAE support in mgmt SDK - from azure.core.pipeline.policies import BearerTokenCredentialPolicy + from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy # Track 2 SDK maintains `scopes` and passes `scopes` to get_token. scopes = resource_to_scopes(cli_ctx.cloud.endpoints.active_directory_resource_id) - policy = BearerTokenCredentialPolicy(cred, *scopes) + policy = ARMChallengeAuthenticationPolicy(cred, *scopes) client_kwargs['credential_scopes'] = scopes client_kwargs['authentication_policy'] = policy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/profiles/_shared.py new/azure-cli-core-2.41.0/azure/cli/core/profiles/_shared.py --- old/azure-cli-core-2.40.0/azure/cli/core/profiles/_shared.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/profiles/_shared.py 2022-10-10 05:01:41.000000000 +0200 @@ -77,6 +77,8 @@ MGMT_DATABOXEDGE = ('azure.mgmt.databoxedge', 'DataBoxEdgeManagementClient') MGMT_CUSTOMLOCATION = ('azure.mgmt.extendedlocation', 'CustomLocations') MGMT_CONTAINERSERVICE = ('azure.mgmt.containerservice', 'ContainerServiceClient') + MGMT_APPCONFIGURATION = ('azure.mgmt.appconfiguration', 'AppConfigurationManagementClient') + # the "None" below will stay till a command module fills in the type so "get_mgmt_service_client" # can be provided with "ResourceType.XXX" to initialize the client object. This usually happens # when related commands start to support Multi-API @@ -105,7 +107,6 @@ MGMT_RDBMS = ('azure.mgmt.rdbms', None) MGMT_REDIS = ('azure.mgmt.redis', None) MGMT_RELAY = ('azure.mgmt.relay', None) - MGMT_RESERVATIONS = ('azure.mgmt.reservations', None) MGMT_SEARCH = ('azure.mgmt.search', None) MGMT_SERVICEFABRIC = ('azure.mgmt.servicefabric', None) MGMT_SIGNALR = ('azure.mgmt.signalr', None) @@ -153,19 +154,19 @@ 'latest': { ResourceType.MGMT_STORAGE: '2022-05-01', ResourceType.MGMT_NETWORK: '2022-01-01', - ResourceType.MGMT_COMPUTE: SDKProfile('2022-03-01', { + ResourceType.MGMT_COMPUTE: SDKProfile('2022-08-01', { 'resource_skus': '2019-04-01', 'disks': '2022-03-02', 'disk_encryption_sets': '2022-03-02', 'disk_accesses': '2020-05-01', - 'snapshots': '2021-12-01', + 'snapshots': '2022-03-02', 'galleries': '2021-10-01', 'gallery_images': '2021-10-01', - 'gallery_image_versions': '2021-10-01', + 'gallery_image_versions': '2022-01-03', 'gallery_applications': '2021-07-01', 'gallery_application_versions': '2022-01-03', 'shared_galleries': '2022-01-03', - 'virtual_machine_scale_sets': '2022-03-01', + 'virtual_machine_scale_sets': '2022-08-01', }), ResourceType.MGMT_RESOURCE_FEATURES: '2021-07-01', ResourceType.MGMT_RESOURCE_LINKS: '2016-09-01', @@ -213,10 +214,10 @@ 'activity_logs': '2015-04-01', 'alert_rule_incidents': '2016-03-01', 'alert_rules': '2016-03-01', - 'autoscale_settings': '2015-04-01', + 'autoscale_settings': '2022-10-01', 'baseline': '2018-09-01', 'baselines': '2019-03-01', - 'diagnostic_settings': '2017-05-01-preview', + 'diagnostic_settings': '2021-05-01-preview', 'diagnostic_settings_category': '2017-05-01-preview', 'event_categories': '2015-04-01', 'guest_diagnostics_settings': '2018-06-01-preview', @@ -248,10 +249,13 @@ ResourceType.MGMT_ARO: '2022-04-01', ResourceType.MGMT_DATABOXEDGE: '2021-02-01-preview', ResourceType.MGMT_CUSTOMLOCATION: '2021-03-15-preview', - ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2022-06-01', { + ResourceType.MGMT_CONTAINERSERVICE: SDKProfile('2022-07-01', { 'container_services': '2017-07-01', 'open_shift_managed_clusters': '2019-09-30-preview' - }) + }), + ResourceType.MGMT_APPCONFIGURATION: SDKProfile('2022-05-01', { + 'replicas': '2022-03-01-preview' + }), }, '2020-09-01-hybrid': { ResourceType.MGMT_STORAGE: '2019-06-01', @@ -408,8 +412,6 @@ # use the version in a profile as much as possible. AD_HOC_API_VERSIONS = { ResourceType.MGMT_NETWORK: { - 'vm_default_target_network': '2018-01-01', - 'nw_connection_monitor': '2019-06-01', 'container_network': '2018-08-01', 'appservice_network': '2020-04-01', 'appservice_ensure_subnet': '2019-02-01' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure/cli/core/util.py new/azure-cli-core-2.41.0/azure/cli/core/util.py --- old/azure-cli-core-2.40.0/azure/cli/core/util.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure/cli/core/util.py 2022-10-10 05:01:41.000000000 +0200 @@ -8,6 +8,7 @@ import binascii import getpass import json +import yaml import logging import os import platform @@ -97,6 +98,14 @@ elif isinstance(ex, ValidationError): az_error = azclierror.ValidationError(error_msg) + elif isinstance(ex, azclierror.HTTPError): + # For resources that don't support CAE - 401 can't be handled + if ex.response.status_code == 401 and 'WWW-Authenticate' in ex.response.headers: + az_error = azclierror.AuthenticationError(ex) + az_error.set_recommendation("Interactive authentication is needed. Please run:\naz logout\naz login") + else: + az_error = azclierror.UnclassifiedUserFault(ex) + elif isinstance(ex, CLIError): # TODO: Fine-grained analysis here az_error = azclierror.UnclassifiedUserFault(error_msg) @@ -527,6 +536,18 @@ raise CLIError("Failed to parse file '{}' with exception:\n{}".format(file_path, ex)) +def get_file_yaml(file_path, throw_on_empty=True): + content = read_file_content(file_path) + if not content: + if throw_on_empty: + raise CLIError("Failed to parse file '{}' with exception:\nNo content in the file.".format(file_path)) + return None + try: + return yaml.safe_load(content) + except yaml.parser.ParserError as ex: + raise CLIError("Failed to parse file '{}' with exception:\n{}".format(file_path, ex)) from ex + + def read_file_content(file_path, allow_binary=False): from codecs import open as codecs_open # Note, always put 'utf-8-sig' first, so that BOM in WinOS won't cause trouble. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure_cli_core.egg-info/PKG-INFO new/azure-cli-core-2.41.0/azure_cli_core.egg-info/PKG-INFO --- old/azure-cli-core-2.40.0/azure_cli_core.egg-info/PKG-INFO 2022-09-02 07:40:15.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure_cli_core.egg-info/PKG-INFO 2022-10-10 05:01:57.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: azure-cli-core -Version: 2.40.0 +Version: 2.41.0 Summary: Microsoft Azure Command-Line Tools Core Module Home-page: https://github.com/Azure/azure-cli Author: Microsoft Corporation @@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: License :: OSI Approved :: MIT License -Requires-Python: >=3.6.0 +Requires-Python: >=3.7.0 License-File: LICENSE.txt Microsoft Azure CLI Core Module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/azure_cli_core.egg-info/requires.txt new/azure-cli-core-2.41.0/azure_cli_core.egg-info/requires.txt --- old/azure-cli-core-2.40.0/azure_cli_core.egg-info/requires.txt 2022-09-02 07:40:15.000000000 +0200 +++ new/azure-cli-core-2.41.0/azure_cli_core.egg-info/requires.txt 2022-10-10 05:01:57.000000000 +0200 @@ -6,7 +6,7 @@ jmespath knack~=0.10.0 msal-extensions~=1.0.0 -msal==1.18.0b1 +msal[broker]==1.20.0b1 msrestazure~=0.6.4 packaging<22.0,>=20.9 paramiko<3.0.0,>=2.0.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/azure-cli-core-2.40.0/setup.py new/azure-cli-core-2.41.0/setup.py --- old/azure-cli-core-2.40.0/setup.py 2022-09-02 07:40:04.000000000 +0200 +++ new/azure-cli-core-2.41.0/setup.py 2022-10-10 05:01:41.000000000 +0200 @@ -8,7 +8,7 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "2.40.0" +VERSION = "2.41.0" # If we have source, validate that our version numbers match # This should prevent uploading releases with mismatched versions. @@ -51,7 +51,7 @@ 'jmespath', 'knack~=0.10.0', 'msal-extensions~=1.0.0', - 'msal==1.18.0b1', + 'msal[broker]==1.20.0b1', 'msrestazure~=0.6.4', 'packaging>=20.9,<22.0', 'paramiko>=2.0.8,<3.0.0', @@ -79,6 +79,6 @@ classifiers=CLASSIFIERS, packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests", "azure", "azure.cli"]), install_requires=DEPENDENCIES, - python_requires='>=3.6.0', + python_requires='>=3.7.0', package_data={'azure.cli.core': ['auth/landing_pages/*.html']} )