1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

chore: update vendored files

This commit is contained in:
jo 2025-06-10 20:35:13 +02:00
parent b126f82b08
commit c3a7b85c0c
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
3 changed files with 14 additions and 7 deletions

View file

@ -1,3 +1,3 @@
from __future__ import annotations
__version__ = "2.5.2" # x-releaser-pleaser-version
__version__ = "2.5.3" # x-releaser-pleaser-version

View file

@ -52,15 +52,22 @@ class DomainIdentityMixin:
the comparison will not work as expected (e.g. the domains are the same but
cannot be equal, if one provides an id and the other the name).
"""
values: list[int | str] = []
result = None
if self.id is not None:
values.append(self.id)
value = id_or_name
if isinstance(id_or_name, str) and id_or_name.isnumeric():
value = int(id_or_name)
result = result or self.id == value
if self.name is not None:
values.append(self.name)
if not values:
result = result or self.name == str(id_or_name)
if result is None:
raise ValueError("id or name must be set")
return id_or_name in values
return result
class Pagination(BaseDomain):

View file

@ -1230,7 +1230,7 @@ class ServersClient(ClientEntityBase):
:param placement_group: :class:`BoundPlacementGroup <hcloud.placement_groups.client.BoundPlacementGroup>` or :class:`Network <hcloud.placement_groups.domain.PlacementGroup>`
:return: :class:`BoundAction <hcloud.actions.client.BoundAction>`
"""
data: dict[str, Any] = {"placement_group": str(placement_group.id)}
data: dict[str, Any] = {"placement_group": placement_group.id}
response = self._client.request(
url=f"/servers/{server.id}/actions/add_to_placement_group",
method="POST",