mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-03 23:51:48 +00:00
refactor: mark private module utils modules
Similar to https://togithub.com/ansible-collections/community.general/issues/11312
This commit is contained in:
parent
0f23e6c58c
commit
8727ba3994
144 changed files with 223 additions and 219 deletions
4
.github/workflows/vendor.yml
vendored
4
.github/workflows/vendor.yml
vendored
|
|
@ -4,11 +4,11 @@ on:
|
|||
push:
|
||||
branches: [main, stable-1]
|
||||
paths:
|
||||
- plugins/module_utils/vendor/**
|
||||
- plugins/module_utils/_vendor/**
|
||||
- scripts/vendor.py
|
||||
pull_request:
|
||||
paths:
|
||||
- plugins/module_utils/vendor/**
|
||||
- plugins/module_utils/_vendor/**
|
||||
- scripts/vendor.py
|
||||
|
||||
jobs:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
# See https://pre-commit.com for more information
|
||||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
exclude: ^plugins/module_utils/vendor/hcloud/.*$
|
||||
exclude: ^plugins/module_utils/_vendor/hcloud/.*$
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -29,7 +29,7 @@ clean:
|
|||
|
||||
sanity:
|
||||
ansible-test sanity --color --truncate 0 -v \
|
||||
--exclude plugins/module_utils/vendor/ \
|
||||
--exclude plugins/module_utils/_vendor/ \
|
||||
--exclude scripts/ \
|
||||
--exclude tests/utils/ \
|
||||
--docker default \
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from typing import Literal
|
|||
from ansible.errors import AnsibleFilterError
|
||||
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
|
||||
|
|
|
|||
|
|
@ -202,16 +202,16 @@ from ansible.plugins.inventory import BaseInventoryPlugin, Cacheable, Constructa
|
|||
from ansible.utils.display import Display
|
||||
from ansible.utils.vars import combine_vars
|
||||
|
||||
from ..module_utils.client import (
|
||||
from ..module_utils._client import (
|
||||
Client,
|
||||
ClientException,
|
||||
client_check_required_lib,
|
||||
client_get_by_name_or_id,
|
||||
)
|
||||
from ..module_utils.vendor.hcloud import APIException
|
||||
from ..module_utils.vendor.hcloud.networks import Network
|
||||
from ..module_utils.vendor.hcloud.servers import Server
|
||||
from ..module_utils.version import version
|
||||
from ..module_utils._vendor.hcloud import APIException
|
||||
from ..module_utils._vendor.hcloud.networks import Network
|
||||
from ..module_utils._vendor.hcloud.servers import Server
|
||||
from ..module_utils._version import version
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
# The typed dicts are only used to help development and we prefer not requiring
|
||||
|
|
|
|||
|
|
@ -16,15 +16,19 @@ from ansible.module_utils.common.validation import (
|
|||
check_required_one_of,
|
||||
)
|
||||
|
||||
from .client import ClientException, client_check_required_lib, client_get_by_name_or_id
|
||||
from .vendor.hcloud import (
|
||||
from ._client import (
|
||||
ClientException,
|
||||
client_check_required_lib,
|
||||
client_get_by_name_or_id,
|
||||
)
|
||||
from ._vendor.hcloud import (
|
||||
APIException,
|
||||
Client,
|
||||
HCloudException,
|
||||
exponential_backoff_function,
|
||||
)
|
||||
from .vendor.hcloud.actions import ActionException
|
||||
from .version import version
|
||||
from ._vendor.hcloud.actions import ActionException
|
||||
from ._version import version
|
||||
|
||||
|
||||
class AnsibleModule(AnsibleModuleBase):
|
||||
|
|
@ -6,7 +6,7 @@ from contextlib import contextmanager
|
|||
|
||||
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_DATEUTIL = True
|
||||
|
|
@ -5,8 +5,8 @@ from datetime import datetime, timezone
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from .vendor.hcloud.locations import BoundLocation
|
||||
from .vendor.hcloud.server_types import BoundServerType, ServerTypeLocation
|
||||
from ._vendor.hcloud.locations import BoundLocation
|
||||
from ._vendor.hcloud.server_types import BoundServerType, ServerTypeLocation
|
||||
|
||||
DEPRECATED_EXISTING_SERVERS = """
|
||||
Existing servers of that type will continue to work as before and no action is \
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
from .hcloud import AnsibleModule
|
||||
from ._base import AnsibleModule
|
||||
|
||||
|
||||
def experimental_warning_function(product: str, maturity: str, url: str):
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ..module_utils.vendor.hcloud.floating_ips import (
|
||||
from ._vendor.hcloud.floating_ips import (
|
||||
BoundFloatingIP,
|
||||
)
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ..module_utils.vendor.hcloud.primary_ips import (
|
||||
from ._vendor.hcloud.primary_ips import (
|
||||
BoundPrimaryIP,
|
||||
)
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ..module_utils.client import client_resource_not_found
|
||||
from ..module_utils.vendor.hcloud.storage_boxes import (
|
||||
from ._client import client_resource_not_found
|
||||
from ._vendor.hcloud.storage_boxes import (
|
||||
BoundStorageBox,
|
||||
StorageBoxesClient,
|
||||
)
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ..module_utils.vendor.hcloud.storage_boxes import (
|
||||
from ._vendor.hcloud.storage_boxes import (
|
||||
BoundStorageBoxSnapshot,
|
||||
)
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from ..module_utils.vendor.hcloud.storage_boxes import (
|
||||
from ._vendor.hcloud.storage_boxes import (
|
||||
BoundStorageBox,
|
||||
BoundStorageBoxSubaccount,
|
||||
)
|
||||
|
|
@ -147,9 +147,9 @@ hcloud_certificate:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ..module_utils.hcloud import AnsibleHCloud
|
||||
from ..module_utils.vendor.hcloud import HCloudException
|
||||
from ..module_utils.vendor.hcloud.certificates import BoundCertificate
|
||||
from ..module_utils._base import AnsibleHCloud
|
||||
from ..module_utils._vendor.hcloud import HCloudException
|
||||
from ..module_utils._vendor.hcloud.certificates import BoundCertificate
|
||||
|
||||
|
||||
class AnsibleHCloudCertificate(AnsibleHCloud):
|
||||
|
|
|
|||
|
|
@ -88,9 +88,9 @@ hcloud_certificate_info:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ..module_utils.hcloud import AnsibleHCloud
|
||||
from ..module_utils.vendor.hcloud import HCloudException
|
||||
from ..module_utils.vendor.hcloud.certificates import BoundCertificate
|
||||
from ..module_utils._base import AnsibleHCloud
|
||||
from ..module_utils._vendor.hcloud import HCloudException
|
||||
from ..module_utils._vendor.hcloud.certificates import BoundCertificate
|
||||
|
||||
|
||||
class AnsibleHCloudCertificateInfo(AnsibleHCloud):
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ hcloud_datacenter_info:
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ..module_utils.hcloud import AnsibleHCloud
|
||||
from ..module_utils.vendor.hcloud import HCloudException
|
||||
from ..module_utils.vendor.hcloud.datacenters import BoundDatacenter
|
||||
from ..module_utils._base import AnsibleHCloud
|
||||
from ..module_utils._vendor.hcloud import HCloudException
|
||||
from ..module_utils._vendor.hcloud.datacenters import BoundDatacenter
|
||||
|
||||
|
||||
class AnsibleHCloudDatacenterInfo(AnsibleHCloud):
|
||||
|
|
|
|||
|
|
@ -220,10 +220,10 @@ import time
|
|||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
from ..module_utils.hcloud import AnsibleHCloud
|
||||
from ..module_utils.ipaddress import normalize_ip
|
||||
from ..module_utils.vendor.hcloud import APIException, HCloudException
|
||||
from ..module_utils.vendor.hcloud.firewalls import (
|
||||
from ..module_utils._base import AnsibleHCloud
|
||||
from ..module_utils._ipaddress import normalize_ip
|
||||
from ..module_utils._vendor.hcloud import APIException, HCloudException
|
||||
from ..module_utils._vendor.hcloud.firewalls import (
|
||||
BoundFirewall,
|
||||
FirewallResource,
|
||||
FirewallRule,
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue