mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-12-12 13:32:31 +00:00
fix: facts deprecation warnings and result (#236)
The facts deprecation warnings or result dicts had some small nits.
This commit is contained in:
parent
dfff49e31f
commit
10f47eab0f
4 changed files with 19 additions and 4 deletions
5
changelogs/fragments/fix-facts-modules-deprecation.yml
Normal file
5
changelogs/fragments/fix-facts-modules-deprecation.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
bugfixes:
|
||||
- hcloud_image_info Fix facts modules deprecated result key
|
||||
- hcloud_location_info Fix facts modules deprecation warnings
|
||||
- hcloud_server_type_info Fix facts modules deprecated result dict
|
||||
- hcloud_server_type_info Fix facts modules deprecation warnings
|
|
@ -207,7 +207,12 @@ def main():
|
|||
result = hcloud.get_result()
|
||||
|
||||
if is_old_facts:
|
||||
ansible_info = {"hcloud_imagen_facts": result["hcloud_image_info"]}
|
||||
ansible_info = {
|
||||
"hcloud_image_facts": result["hcloud_image_info"],
|
||||
# We keep the key with a typo below to prevent a breaking changes.
|
||||
# The entire module will be removed in v2.0.0
|
||||
"hcloud_imagen_facts": result["hcloud_image_info"],
|
||||
}
|
||||
module.exit_json(ansible_facts=ansible_info)
|
||||
else:
|
||||
ansible_info = {"hcloud_image_info": result["hcloud_image_info"]}
|
||||
|
|
|
@ -132,7 +132,7 @@ def main():
|
|||
is_old_facts = module._name == "hcloud_location_facts"
|
||||
if is_old_facts:
|
||||
module.deprecate(
|
||||
"The 'hcloud_location_info' module has been renamed to 'hcloud_location_info', "
|
||||
"The 'hcloud_location_facts' module has been renamed to 'hcloud_location_info', "
|
||||
"and the renamed one no longer returns ansible_facts",
|
||||
version="2.0.0",
|
||||
collection_name="hetzner.hcloud",
|
||||
|
|
|
@ -189,7 +189,7 @@ def main():
|
|||
is_old_facts = module._name == "hcloud_server_type_facts"
|
||||
if is_old_facts:
|
||||
module.deprecate(
|
||||
"The 'hcloud_server_type_info' module has been renamed to 'hcloud_server_type_info', "
|
||||
"The 'hcloud_server_type_facts' module has been renamed to 'hcloud_server_type_info', "
|
||||
"and the renamed one no longer returns ansible_facts",
|
||||
version="2.0.0",
|
||||
collection_name="hetzner.hcloud",
|
||||
|
@ -199,7 +199,12 @@ def main():
|
|||
hcloud.get_server_types()
|
||||
result = hcloud.get_result()
|
||||
if is_old_facts:
|
||||
ansible_info = {"hcloud_server_type_info": result["hcloud_server_type_info"]}
|
||||
ansible_info = {
|
||||
"hcloud_server_type_facts": result["hcloud_server_type_info"],
|
||||
# We keep the key with a naming mistake below to prevent a breaking changes.
|
||||
# The entire module will be removed in v2.0.0
|
||||
"hcloud_server_type_info": result["hcloud_server_type_info"],
|
||||
}
|
||||
module.exit_json(ansible_facts=ansible_info)
|
||||
else:
|
||||
ansible_info = {"hcloud_server_type_info": result["hcloud_server_type_info"]}
|
||||
|
|
Loading…
Reference in a new issue