mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +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:
parent
0f23e6c58c
commit
cfa0d181f7
152 changed files with 283 additions and 239 deletions
44
plugins/module_utils/_experimental.py
Normal file
44
plugins/module_utils/_experimental.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# 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 ._base import AnsibleModule
|
||||
|
||||
|
||||
def experimental_warning_function(product: str, maturity: str, url: str):
|
||||
"""
|
||||
Create a reusable experimental warning function.
|
||||
|
||||
Usage:
|
||||
|
||||
product_experimental_warning = experimental_warning_function(
|
||||
"Product",
|
||||
"in beta",
|
||||
"https://docs.hetzner.cloud/changelog#new-product",
|
||||
)
|
||||
|
||||
class AnsibleProduct(AnsibleHCloud):
|
||||
def __init__(self, module: AnsibleModule):
|
||||
product_experimental_warning(module)
|
||||
super().__init__(module)
|
||||
|
||||
:param product: Name of the product.
|
||||
:param maturity: Maturity of the product.
|
||||
:param url: Changelog URL announcing the product.
|
||||
"""
|
||||
message = f"Experimental: {product} is {maturity}, breaking changes may occur within minor releases. See {url} for more details."
|
||||
|
||||
def fn(module: AnsibleModule):
|
||||
module.warn(message)
|
||||
|
||||
return fn
|
||||
|
||||
|
||||
storage_box_experimental_warning = experimental_warning_function(
|
||||
"Storage Box support",
|
||||
"experimental",
|
||||
"https://github.com/ansible-collections/hetzner.hcloud/issues/756",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue