From ac80d2ba7c4764ab4e5c02a5837900a8851828eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:17:35 +0100 Subject: [PATCH] deps: update dependency hcloud to v1.34.0 (#480) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [hcloud](https://togithub.com/hetznercloud/hcloud-python) ([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md)) | `1.33.3` -> `1.34.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.33.3/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.33.3/1.34.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
hetznercloud/hcloud-python (hcloud) ### [`v1.34.0`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#1340-2024-03-27) [Compare Source](https://togithub.com/hetznercloud/hcloud-python/compare/v1.33.3...v1.34.0) ##### Features - add `has_id_or_name` to `DomainIdentityMixin` ([#​373](https://togithub.com/hetznercloud/hcloud-python/issues/373)) ([8facaf6](https://togithub.com/hetznercloud/hcloud-python/commit/8facaf6d4dd2bbfb4137e7066b49c5f4c1db773c))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ansible-collections/hetzner.hcloud). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jo --- plugins/module_utils/vendor/hcloud/_version.py | 2 +- .../module_utils/vendor/hcloud/core/domain.py | 18 ++++++++++++++++++ .../vendor/hcloud/firewalls/domain.py | 4 ++-- .../vendor/hcloud/floating_ips/domain.py | 4 ++-- .../vendor/hcloud/load_balancers/domain.py | 4 ++-- .../vendor/hcloud/networks/domain.py | 4 ++-- .../vendor/hcloud/placement_groups/domain.py | 4 ++-- .../vendor/hcloud/primary_ips/domain.py | 4 ++-- .../vendor/hcloud/servers/domain.py | 4 ++-- scripts/vendor.py | 2 +- 10 files changed, 34 insertions(+), 16 deletions(-) diff --git a/plugins/module_utils/vendor/hcloud/_version.py b/plugins/module_utils/vendor/hcloud/_version.py index b4bf770..b592a1b 100644 --- a/plugins/module_utils/vendor/hcloud/_version.py +++ b/plugins/module_utils/vendor/hcloud/_version.py @@ -1,3 +1,3 @@ from __future__ import annotations -VERSION = "1.33.3" # x-release-please-version +VERSION = "1.34.0" # x-release-please-version diff --git a/plugins/module_utils/vendor/hcloud/core/domain.py b/plugins/module_utils/vendor/hcloud/core/domain.py index 692f748..bba954f 100644 --- a/plugins/module_utils/vendor/hcloud/core/domain.py +++ b/plugins/module_utils/vendor/hcloud/core/domain.py @@ -34,6 +34,24 @@ class DomainIdentityMixin: return self.name raise ValueError("id or name must be set") + def has_id_or_name(self, id_or_name: int | str) -> bool: + """ + Return whether this domain has the same id or same name as the other. + + The domain calling this method MUST be a bound domain or be populated, otherwise + 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] = [] + if self.id is not None: + values.append(self.id) + if self.name is not None: + values.append(self.name) + if not values: + raise ValueError("id or name must be set") + + return id_or_name in values + class Pagination(BaseDomain): __slots__ = ( diff --git a/plugins/module_utils/vendor/hcloud/firewalls/domain.py b/plugins/module_utils/vendor/hcloud/firewalls/domain.py index 5ce9281..d637231 100644 --- a/plugins/module_utils/vendor/hcloud/firewalls/domain.py +++ b/plugins/module_utils/vendor/hcloud/firewalls/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundFirewall -class Firewall(BaseDomain): +class Firewall(BaseDomain, DomainIdentityMixin): """Firewall Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/floating_ips/domain.py b/plugins/module_utils/vendor/hcloud/floating_ips/domain.py index e1f295b..abd2c13 100644 --- a/plugins/module_utils/vendor/hcloud/floating_ips/domain.py +++ b/plugins/module_utils/vendor/hcloud/floating_ips/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -16,7 +16,7 @@ if TYPE_CHECKING: from .client import BoundFloatingIP -class FloatingIP(BaseDomain): +class FloatingIP(BaseDomain, DomainIdentityMixin): """Floating IP Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/load_balancers/domain.py b/plugins/module_utils/vendor/hcloud/load_balancers/domain.py index cc5f122..76e8db3 100644 --- a/plugins/module_utils/vendor/hcloud/load_balancers/domain.py +++ b/plugins/module_utils/vendor/hcloud/load_balancers/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -20,7 +20,7 @@ if TYPE_CHECKING: from .client import BoundLoadBalancer -class LoadBalancer(BaseDomain): +class LoadBalancer(BaseDomain, DomainIdentityMixin): """LoadBalancer Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/networks/domain.py b/plugins/module_utils/vendor/hcloud/networks/domain.py index c307bf9..e04de27 100644 --- a/plugins/module_utils/vendor/hcloud/networks/domain.py +++ b/plugins/module_utils/vendor/hcloud/networks/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundNetwork -class Network(BaseDomain): +class Network(BaseDomain, DomainIdentityMixin): """Network Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/placement_groups/domain.py b/plugins/module_utils/vendor/hcloud/placement_groups/domain.py index 16b2a39..1c6fc04 100644 --- a/plugins/module_utils/vendor/hcloud/placement_groups/domain.py +++ b/plugins/module_utils/vendor/hcloud/placement_groups/domain.py @@ -7,14 +7,14 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction from .client import BoundPlacementGroup -class PlacementGroup(BaseDomain): +class PlacementGroup(BaseDomain, DomainIdentityMixin): """Placement Group Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/primary_ips/domain.py b/plugins/module_utils/vendor/hcloud/primary_ips/domain.py index aeb943f..2eebace 100644 --- a/plugins/module_utils/vendor/hcloud/primary_ips/domain.py +++ b/plugins/module_utils/vendor/hcloud/primary_ips/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -15,7 +15,7 @@ if TYPE_CHECKING: from .client import BoundPrimaryIP -class PrimaryIP(BaseDomain): +class PrimaryIP(BaseDomain, DomainIdentityMixin): """Primary IP Domain :param id: int diff --git a/plugins/module_utils/vendor/hcloud/servers/domain.py b/plugins/module_utils/vendor/hcloud/servers/domain.py index 0a0d346..d5e769e 100644 --- a/plugins/module_utils/vendor/hcloud/servers/domain.py +++ b/plugins/module_utils/vendor/hcloud/servers/domain.py @@ -7,7 +7,7 @@ try: except ImportError: isoparse = None -from ..core import BaseDomain +from ..core import BaseDomain, DomainIdentityMixin if TYPE_CHECKING: from ..actions import BoundAction @@ -25,7 +25,7 @@ if TYPE_CHECKING: from .client import BoundServer -class Server(BaseDomain): +class Server(BaseDomain, DomainIdentityMixin): """Server Domain :param id: int diff --git a/scripts/vendor.py b/scripts/vendor.py index ee3541a..26a51ca 100755 --- a/scripts/vendor.py +++ b/scripts/vendor.py @@ -22,7 +22,7 @@ from textwrap import dedent logger = logging.getLogger("vendor") HCLOUD_SOURCE_URL = "https://github.com/hetznercloud/hcloud-python" -HCLOUD_VERSION = "v1.33.3" +HCLOUD_VERSION = "v1.34.0" HCLOUD_VENDOR_PATH = "plugins/module_utils/vendor/hcloud"