1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-03 23:51:48 +00:00

chore(deps): update dependency hcloud to v2.11.1 (#738)

This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [hcloud](https://redirect.github.com/hetznercloud/hcloud-python)
([changelog](https://redirect.github.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md))
| `2.11.0` -> `2.11.1` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/2.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/2.11.0/2.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>hetznercloud/hcloud-python (hcloud)</summary>

###
[`v2.11.1`](https://redirect.github.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#v2111)

[Compare
Source](https://redirect.github.com/hetznercloud/hcloud-python/compare/v2.11.0...v2.11.1)

##### Bug Fixes

- support reloading sub resource bound models
([#&#8203;590](https://redirect.github.com/hetznercloud/hcloud-python/issues/590))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/ansible-collections/hetzner.hcloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: jo <ljonas@riseup.net>
This commit is contained in:
renovate[bot] 2025-11-14 16:06:41 +01:00 committed by GitHub
parent a4e1d78bcb
commit f87c23629b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 35 additions and 26 deletions

View file

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

View file

@ -202,7 +202,7 @@ class CertificatesClient(ResourceClientBase):
Used to get certificate by name.
:return: :class:`BoundCertificate <hcloud.certificates.client.BoundCertificate>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -46,10 +46,8 @@ class ResourceClientBase:
return results
def _get_first_by(self, **kwargs): # type: ignore[no-untyped-def]
assert hasattr(self, "get_list")
# pylint: disable=no-member
entities, _ = self.get_list(**kwargs)
def _get_first_by(self, list_function: Callable, *args, **kwargs): # type: ignore[no-untyped-def]
entities, _ = list_function(*args, **kwargs)
return entities[0] if entities else None
@ -105,10 +103,13 @@ class BoundModelBase:
value = getattr(self.data_model, name)
return value
def reload(self) -> None:
"""Reloads the model and tries to get all data from the APIx"""
def _get_self(self) -> BoundModelBase:
assert hasattr(self._client, "get_by_id")
bound_model = self._client.get_by_id(self.data_model.id)
return self._client.get_by_id(self.data_model.id)
def reload(self) -> None:
"""Reloads the model and tries to get all data from the API"""
bound_model = self._get_self()
self.data_model = bound_model.data_model
self.complete = True

View file

@ -115,4 +115,4 @@ class DatacentersClient(ResourceClientBase):
Used to get datacenter by name.
:return: :class:`BoundDatacenter <hcloud.datacenters.client.BoundDatacenter>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)

View file

@ -351,7 +351,7 @@ class FirewallsClient(ResourceClientBase):
Used to get Firewall by name.
:return: :class:`BoundFirewall <hcloud.firewalls.client.BoundFirewall>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -293,7 +293,7 @@ class FloatingIPsClient(ResourceClientBase):
Used to get Floating IP by name.
:return: :class:`BoundFloatingIP <hcloud.floating_ips.client.BoundFloatingIP>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -329,7 +329,7 @@ class ImagesClient(ResourceClientBase):
DeprecationWarning,
stacklevel=2,
)
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def get_by_name_and_architecture(
self,
@ -349,6 +349,7 @@ class ImagesClient(ResourceClientBase):
:return: :class:`BoundImage <hcloud.images.client.BoundImage>`
"""
return self._get_first_by(
self.get_list,
name=name,
architecture=[architecture],
include_deprecated=include_deprecated,

View file

@ -99,4 +99,4 @@ class IsosClient(ResourceClientBase):
Used to get iso by name.
:return: :class:`BoundIso <hcloud.isos.client.BoundIso>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)

View file

@ -81,4 +81,4 @@ class LoadBalancerTypesClient(ResourceClientBase):
Used to get Load Balancer type by name.
:return: :class:`BoundLoadBalancerType <hcloud.load_balancer_types.client.BoundLoadBalancerType>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)

View file

@ -470,7 +470,7 @@ class LoadBalancersClient(ResourceClientBase):
Used to get Load Balancer by name.
:return: :class:`BoundLoadBalancer <hcloud.load_balancers.client.BoundLoadBalancer>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -76,4 +76,4 @@ class LocationsClient(ResourceClientBase):
Used to get location by name.
:return: :class:`BoundLocation <hcloud.locations.client.BoundLocation>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)

View file

@ -252,7 +252,7 @@ class NetworksClient(ResourceClientBase):
Used to get network by name.
:return: :class:`BoundNetwork <hcloud.networks.client.BoundNetwork>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -131,7 +131,7 @@ class PlacementGroupsClient(ResourceClientBase):
Used to get Placement Group by name
:return: class:`BoundPlacementGroup <hcloud.placement_groups.client.BoundPlacementGroup>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -189,7 +189,7 @@ class PrimaryIPsClient(ResourceClientBase):
Used to get Primary IP by name.
:return: :class:`BoundPrimaryIP <hcloud.primary_ips.client.BoundPrimaryIP>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -99,4 +99,4 @@ class ServerTypesClient(ResourceClientBase):
Used to get Server type by name.
:return: :class:`BoundServerType <hcloud.server_types.client.BoundServerType>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)

View file

@ -599,7 +599,7 @@ class ServersClient(ResourceClientBase):
Used to get server by name.
:return: :class:`BoundServer <hcloud.servers.client.BoundServer>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
# pylint: disable=too-many-branches,too-many-locals
def create(

View file

@ -121,7 +121,7 @@ class SSHKeysClient(ResourceClientBase):
Used to get ssh key by name.
:return: :class:`BoundSSHKey <hcloud.ssh_keys.client.BoundSSHKey>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def get_by_fingerprint(self, fingerprint: str) -> BoundSSHKey | None:
"""Get ssh key by fingerprint
@ -130,7 +130,7 @@ class SSHKeysClient(ResourceClientBase):
Used to get ssh key by fingerprint.
:return: :class:`BoundSSHKey <hcloud.ssh_keys.client.BoundSSHKey>`
"""
return self._get_first_by(fingerprint=fingerprint)
return self._get_first_by(self.get_list, fingerprint=fingerprint)
def create(
self,

View file

@ -225,7 +225,7 @@ class VolumesClient(ResourceClientBase):
Used to get volume by name.
:return: :class:`BoundVolume <hcloud.volumes.client.BoundVolume>`
"""
return self._get_first_by(name=name)
return self._get_first_by(self.get_list, name=name)
def create(
self,

View file

@ -406,6 +406,13 @@ class BoundZoneRRSet(BoundModelBase, ZoneRRSet):
super().__init__(client, data, complete)
def _get_self(self) -> BoundZoneRRSet:
return self._client.get_rrset(
self.data_model.zone,
self.data_model.name,
self.data_model.type,
)
def update_rrset(
self,
*,

View file

@ -22,7 +22,7 @@ from textwrap import dedent
logger = logging.getLogger("vendor")
HCLOUD_SOURCE_URL = "https://github.com/hetznercloud/hcloud-python"
HCLOUD_VERSION = "v2.11.0"
HCLOUD_VERSION = "v2.11.1"
HCLOUD_VENDOR_PATH = "plugins/module_utils/vendor/hcloud"