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

refactor: mark module_utils modules as private (#782)

##### SUMMARY

All `module_utils` are now marked as **private**. None of the modules
were intended for public use.

Similar to
https://togithub.com/ansible-collections/community.general/issues/11312
This commit is contained in:
Jonas L. 2026-01-06 08:43:46 +01:00 committed by GitHub
parent 0f23e6c58c
commit cfa0d181f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
152 changed files with 283 additions and 239 deletions

View file

@ -4,11 +4,11 @@ on:
push: push:
branches: [main, stable-1] branches: [main, stable-1]
paths: paths:
- plugins/module_utils/vendor/** - plugins/module_utils/_vendor/**
- scripts/vendor.py - scripts/vendor.py
pull_request: pull_request:
paths: paths:
- plugins/module_utils/vendor/** - plugins/module_utils/_vendor/**
- scripts/vendor.py - scripts/vendor.py
jobs: jobs:

View file

@ -1,7 +1,7 @@
--- ---
# See https://pre-commit.com for more information # See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
exclude: ^plugins/module_utils/vendor/hcloud/.*$ exclude: ^plugins/module_utils/_vendor/hcloud/.*$
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0 rev: v6.0.0

View file

@ -29,7 +29,7 @@ clean:
sanity: sanity:
ansible-test sanity --color --truncate 0 -v \ ansible-test sanity --color --truncate 0 -v \
--exclude plugins/module_utils/vendor/ \ --exclude plugins/module_utils/_vendor/ \
--exclude scripts/ \ --exclude scripts/ \
--exclude tests/utils/ \ --exclude tests/utils/ \
--docker default \ --docker default \

View file

@ -0,0 +1,2 @@
minor_changes:
- All ``module_utils`` are now marked as **private**. None of the modules were intended for public use.

View file

@ -5,7 +5,7 @@ from typing import Literal
from ansible.errors import AnsibleFilterError from ansible.errors import AnsibleFilterError
from ansible.module_utils.common.text.converters import to_native from ansible.module_utils.common.text.converters import to_native
from ..module_utils.vendor.hcloud.exp.zone import format_txt_record from ..module_utils._vendor.hcloud.exp.zone import format_txt_record
# pylint: disable=unused-argument # pylint: disable=unused-argument

View file

@ -202,16 +202,16 @@ from ansible.plugins.inventory import BaseInventoryPlugin, Cacheable, Constructa
from ansible.utils.display import Display from ansible.utils.display import Display
from ansible.utils.vars import combine_vars from ansible.utils.vars import combine_vars
from ..module_utils.client import ( from ..module_utils._client import (
Client, Client,
ClientException, ClientException,
client_check_required_lib, client_check_required_lib,
client_get_by_name_or_id, client_get_by_name_or_id,
) )
from ..module_utils.vendor.hcloud import APIException from ..module_utils._vendor.hcloud import APIException
from ..module_utils.vendor.hcloud.networks import Network from ..module_utils._vendor.hcloud.networks import Network
from ..module_utils.vendor.hcloud.servers import Server from ..module_utils._vendor.hcloud.servers import Server
from ..module_utils.version import version from ..module_utils._version import version
if sys.version_info >= (3, 11): if sys.version_info >= (3, 11):
# The typed dicts are only used to help development and we prefer not requiring # The typed dicts are only used to help development and we prefer not requiring

View file

@ -1,7 +1,7 @@
# Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de> # Copyright: (c) 2019, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) # Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
@ -16,15 +16,19 @@ from ansible.module_utils.common.validation import (
check_required_one_of, check_required_one_of,
) )
from .client import ClientException, client_check_required_lib, client_get_by_name_or_id from ._client import (
from .vendor.hcloud import ( ClientException,
client_check_required_lib,
client_get_by_name_or_id,
)
from ._vendor.hcloud import (
APIException, APIException,
Client, Client,
HCloudException, HCloudException,
exponential_backoff_function, exponential_backoff_function,
) )
from .vendor.hcloud.actions import ActionException from ._vendor.hcloud.actions import ActionException
from .version import version from ._version import version
class AnsibleModule(AnsibleModuleBase): class AnsibleModule(AnsibleModuleBase):

View file

@ -1,12 +1,15 @@
# Copyright: (c) 2023, Hetzner Cloud GmbH <info@hetzner-cloud.de> # Copyright: (c) 2023, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from contextlib import contextmanager from contextlib import contextmanager
from ansible.module_utils.basic import missing_required_lib from ansible.module_utils.basic import missing_required_lib
from .vendor.hcloud import APIException, Client as ClientBase from ._vendor.hcloud import APIException, Client as ClientBase
HAS_REQUESTS = True HAS_REQUESTS = True
HAS_DATEUTIL = True HAS_DATEUTIL = True

View file

@ -1,3 +1,6 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
import warnings import warnings
@ -5,8 +8,8 @@ from datetime import datetime, timezone
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
from .vendor.hcloud.locations import BoundLocation from ._vendor.hcloud.locations import BoundLocation
from .vendor.hcloud.server_types import BoundServerType, ServerTypeLocation from ._vendor.hcloud.server_types import BoundServerType, ServerTypeLocation
DEPRECATED_EXISTING_SERVERS = """ DEPRECATED_EXISTING_SERVERS = """
Existing servers of that type will continue to work as before and no action is \ Existing servers of that type will continue to work as before and no action is \

View file

@ -1,8 +1,11 @@
# Copyright: (c) 2025, Hetzner Cloud GmbH <info@hetzner-cloud.de> # Copyright: (c) 2025, Hetzner Cloud GmbH <info@hetzner-cloud.de>
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from .hcloud import AnsibleModule from ._base import AnsibleModule
def experimental_warning_function(product: str, maturity: str, url: str): def experimental_warning_function(product: str, maturity: str, url: str):

View file

@ -1,6 +1,9 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from ..module_utils.vendor.hcloud.floating_ips import ( from ._vendor.hcloud.floating_ips import (
BoundFloatingIP, BoundFloatingIP,
) )

View file

@ -0,0 +1,10 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations
from ipaddress import ip_interface
def normalize_ip(value: str) -> str:
return str(ip_interface(value))

View file

@ -1,6 +1,9 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from ..module_utils.vendor.hcloud.primary_ips import ( from ._vendor.hcloud.primary_ips import (
BoundPrimaryIP, BoundPrimaryIP,
) )

View file

@ -1,3 +1,6 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from base64 import b64decode from base64 import b64decode

View file

@ -1,7 +1,10 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from ..module_utils.client import client_resource_not_found from ._client import client_resource_not_found
from ..module_utils.vendor.hcloud.storage_boxes import ( from ._vendor.hcloud.storage_boxes import (
BoundStorageBox, BoundStorageBox,
StorageBoxesClient, StorageBoxesClient,
) )

View file

@ -1,6 +1,9 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from ..module_utils.vendor.hcloud.storage_boxes import ( from ._vendor.hcloud.storage_boxes import (
BoundStorageBoxSnapshot, BoundStorageBoxSnapshot,
) )

View file

@ -1,6 +1,9 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations from __future__ import annotations
from ..module_utils.vendor.hcloud.storage_boxes import ( from ._vendor.hcloud.storage_boxes import (
BoundStorageBox, BoundStorageBox,
BoundStorageBoxSubaccount, BoundStorageBoxSubaccount,
) )

View file

@ -0,0 +1,2 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!

View file

@ -0,0 +1,6 @@
# Note that this module util is **PRIVATE** to the collection. It can have breaking changes at any time.
# Do not use this from other collections or standalone plugins/modules!
from __future__ import annotations
version = "6.4.0" # x-release-please-version

View file

@ -1,7 +0,0 @@
from __future__ import annotations
from ipaddress import ip_interface
def normalize_ip(value: str) -> str:
return str(ip_interface(value))

View file

@ -1,3 +0,0 @@
from __future__ import annotations
version = "6.4.0" # x-release-please-version

Some files were not shown because too many files have changed in this diff Show more