Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/aem/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Release History
===============
1.0.0
+++++
* Remove msrestazure dependency
Comment on lines +5 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Releasing it as 1.0.0 will assign a major version which has semantic versioning implications. Can we use 0.3.1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


0.3.0
+++++
Expand Down
10 changes: 5 additions & 5 deletions src/aem/azext_aem/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from azure.cli.core.util import sdk_no_wait
from azure.cli.core.profiles import ResourceType, get_sdk
from azure.cli.core.commands.client_factory import get_mgmt_service_client, get_data_service_client
from azure.core.exceptions import HttpResponseError
from azure.mgmt.compute.models import ResourceIdentityType
from msrestazure.tools import parse_resource_id
from msrestazure.azure_exceptions import CloudError
from azure.mgmt.core.tools import parse_resource_id

from knack.util import CLIError
from knack.log import get_logger
Expand Down Expand Up @@ -265,10 +265,10 @@ def _create_role_assignments_for_scopes(self, scopes):

self._roles_client.role_assignments.create(scope, assignment_name, params_role_assignment)
created = True
except CloudError as cex:
except HttpResponseError as cex:
logger.info("Error during role assignment %s", cex)
if ((not cex.error) or (not cex.error.error) or
(PRINCIPAL_NOT_FOUND_ERROR != cex.error.error.lower())):
if ((not cex.error) or (not cex.error.code) or
(PRINCIPAL_NOT_FOUND_ERROR != cex.error.code.lower())):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If principalType (--assignee-principal-type in az role assignment create) is provided, creating role assignment won't fail at all.

I tested with a non-existing assignee without principalType and verified the cex.error.code is indeed PrincipalNotFound:

az role assignment create --role Contributor --assignee-object-id 8ada7388-5e1f-4455-8693-909abcc039d2 --scope /subscriptions/xxx

image

raise

if (not created) and ((datetime.now() - start_time).total_seconds() < MAX_WAIT_TIME_FOR_SP_SECONDS):
Expand Down
2 changes: 1 addition & 1 deletion src/aem/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.3.0"
VERSION = "1.0.0"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down
Loading