mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
fix: add experimental features maturity (#698)
##### SUMMARY Allow to specify the maturity of the experimental product. ##### ISSUE TYPE - Bugfix Pull Request
This commit is contained in:
parent
728c8b4b25
commit
1251ee0e6f
3 changed files with 33 additions and 7 deletions
|
|
@ -5,14 +5,16 @@ from __future__ import annotations
|
|||
from .hcloud import AnsibleModule
|
||||
|
||||
|
||||
def experimental_warning_function(product: str, url: str):
|
||||
def experimental_warning_function(product: str, maturity: str, url: str):
|
||||
"""
|
||||
Create a reusable experimental warning function.
|
||||
|
||||
Usage:
|
||||
|
||||
product_experimental_warning = experimental_warning_function(
|
||||
"Product", "https://docs.hetzner.cloud/changelog#new-product"
|
||||
"Product",
|
||||
"in beta",
|
||||
"https://docs.hetzner.cloud/changelog#new-product",
|
||||
)
|
||||
|
||||
class AnsibleProduct(AnsibleHCloud):
|
||||
|
|
@ -20,10 +22,11 @@ def experimental_warning_function(product: str, url: str):
|
|||
product_experimental_warning(module)
|
||||
super().__init__(module)
|
||||
|
||||
:param product: Name of the experimental product.
|
||||
:param url: Changelog URL announcing the experimental product.
|
||||
:param product: Name of the product.
|
||||
:param maturity: Maturity of the product.
|
||||
:param url: Changelog URL announcing the product.
|
||||
"""
|
||||
message = f"Experimental: {product} is experimental, breaking changes may occur within minor releases. See {url} for more details."
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue