Skip to content

Commit

Permalink
bugfix (#409)
Browse files Browse the repository at this point in the history
* bugfix

* Update CHANGELOG.md
  • Loading branch information
tora-kozic committed Feb 22, 2022
1 parent c83c3b6 commit 1d48b4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The intended audience of this file is for py42 consumers -- as such, changes that don't affect
how a consumer would use the library (e.g. adding unit tests, updating documentation, etc) are not captured here.

## 1.21.1 - 2022-02-22

### Fixed

- Bug with incorrect error being raised `sdk.detectionlists.add_user_cloud_alias()`

## 1.21.0 - 2022-02-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/py42/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# py42

__version__ = "1.21.0"
__version__ = "1.21.1"
4 changes: 2 additions & 2 deletions src/py42/services/detectionlists/user_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ def add_cloud_alias(self, user_id, alias):
try:
return self._connection.post(uri, json=data)
except Py42BadRequestError as err:
if "A max of 2 cloud aliases are allowed" in err.response.text:
if "Cloud usernames must be less than or equal to" in err.response.text:
raise Py42CloudAliasLimitExceededError(err)
raise err
raise

def remove_cloud_alias(self, user_id, alias):
"""Remove one or more cloud alias.
Expand Down
2 changes: 1 addition & 1 deletion tests/services/detectionlists/test_user_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_add_cloud_alias_limit_raises_custom_error_on_limit(
detection_list_user_client = DetectionListUserService(
mock_connection, user_context, mock_user_client
)
text = "AddCloudAliases: A max of 2 cloud aliases are allowed"
text = "Cloud usernames must be less than or equal to 2"
mock_connection.post.side_effect = create_mock_error(
Py42BadRequestError, mocker, text
)
Expand Down

0 comments on commit 1d48b4d

Please sign in to comment.