Skip to content

Commit

Permalink
version 1.0.10: handle UDM REST API immediate moves
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceone authored and dansan committed Oct 19, 2022
1 parent 32b6168 commit 431bf3a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
History
=======

1.0.11 (2022-10-19)
------------------

* Handle UDM REST API doing immediate moves (without redirects) for objects without subordinates.

1.0.10 (2022-10-13)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
python_requires=">=3.6",
scripts=["update_openapi_client"],
url="https://github.com/univention/python-udm-rest-api-client",
version="1.0.10",
version="1.0.11",
zip_safe=False,
)
2 changes: 1 addition & 1 deletion udm_rest_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@
]
__author__ = """Daniel Troeder"""
__email__ = "troeder@univention.de"
__version__ = "1.0.10"
__version__ = "1.0.11"
5 changes: 4 additions & 1 deletion udm_rest_client/base_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,14 +831,17 @@ async def _move(self, position: str) -> ApiModel:
)
except APICommunicationError as exc:
raise MoveError(f"Error moving {self} to {position!r}: [{exc.status}] {exc.reason}")
if status != 201: # pragma: no cover
if status not in (200, 201, 202): # pragma: no cover
raise MoveError(
f"Error moving {self} to {position!r}:\nHTTP [{status}]\n"
f"response: {new_api_obj!r}\nheader: {header!r}'",
dn=self.dn,
module_name=self._udm_module.name,
)

if status == 200: # pragma: no cover
return new_api_obj

udm_api_response = await self._follow_move_redirects(header["Location"], position)

api_obj_attrs = [
Expand Down

0 comments on commit 431bf3a

Please sign in to comment.