From 0fcf4aad22e0a14e4b1f3e472476af48ee05d0a1 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Tue, 27 Jun 2023 13:17:21 +0200 Subject: [PATCH] refactor: use new to_native function path (#238) https://github.com/ansible/ansible/blob/e535eb625b2edf847ca5008e30ac1f45593dc680/lib/ansible/module_utils/_text.py --- plugins/inventory/hcloud.py | 2 +- plugins/modules/hcloud_certificate.py | 2 +- plugins/modules/hcloud_certificate_info.py | 2 +- plugins/modules/hcloud_datacenter_info.py | 2 +- plugins/modules/hcloud_firewall.py | 2 +- plugins/modules/hcloud_floating_ip.py | 2 +- plugins/modules/hcloud_floating_ip_info.py | 2 +- plugins/modules/hcloud_image_info.py | 2 +- plugins/modules/hcloud_load_balancer.py | 2 +- plugins/modules/hcloud_load_balancer_info.py | 2 +- plugins/modules/hcloud_load_balancer_network.py | 2 +- plugins/modules/hcloud_load_balancer_service.py | 2 +- plugins/modules/hcloud_load_balancer_target.py | 2 +- plugins/modules/hcloud_load_balancer_type_info.py | 2 +- plugins/modules/hcloud_location_info.py | 2 +- plugins/modules/hcloud_network.py | 2 +- plugins/modules/hcloud_network_info.py | 2 +- plugins/modules/hcloud_placement_group.py | 2 +- plugins/modules/hcloud_primary_ip.py | 2 +- plugins/modules/hcloud_primary_ip_info.py | 2 +- plugins/modules/hcloud_rdns.py | 2 +- plugins/modules/hcloud_route.py | 2 +- plugins/modules/hcloud_server.py | 2 +- plugins/modules/hcloud_server_info.py | 2 +- plugins/modules/hcloud_server_network.py | 2 +- plugins/modules/hcloud_server_type_info.py | 2 +- plugins/modules/hcloud_ssh_key.py | 2 +- plugins/modules/hcloud_ssh_key_info.py | 2 +- plugins/modules/hcloud_subnetwork.py | 2 +- plugins/modules/hcloud_volume.py | 2 +- plugins/modules/hcloud_volume_info.py | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/plugins/inventory/hcloud.py b/plugins/inventory/hcloud.py index 9682947..dadf795 100644 --- a/plugins/inventory/hcloud.py +++ b/plugins/inventory/hcloud.py @@ -118,7 +118,7 @@ import os from ipaddress import IPv6Network from ansible.errors import AnsibleError -from ansible.module_utils._text import to_native +from ansible.module_utils.common.text.converters import to_native from ansible.plugins.inventory import BaseInventoryPlugin, Constructable from ansible.release import __version__ diff --git a/plugins/modules/hcloud_certificate.py b/plugins/modules/hcloud_certificate.py index acb4b6c..c294465 100644 --- a/plugins/modules/hcloud_certificate.py +++ b/plugins/modules/hcloud_certificate.py @@ -134,8 +134,8 @@ hcloud_certificate: type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_certificate_info.py b/plugins/modules/hcloud_certificate_info.py index e41aa44..84c2414 100644 --- a/plugins/modules/hcloud_certificate_info.py +++ b/plugins/modules/hcloud_certificate_info.py @@ -82,8 +82,8 @@ hcloud_certificate_info: returned: always type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_datacenter_info.py b/plugins/modules/hcloud_datacenter_info.py index 5c4b835..7ccba0f 100644 --- a/plugins/modules/hcloud_datacenter_info.py +++ b/plugins/modules/hcloud_datacenter_info.py @@ -77,8 +77,8 @@ hcloud_datacenter_info: sample: fsn1 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_firewall.py b/plugins/modules/hcloud_firewall.py index 3677d73..4ecf480 100644 --- a/plugins/modules/hcloud_firewall.py +++ b/plugins/modules/hcloud_firewall.py @@ -168,8 +168,8 @@ hcloud_firewall: import time -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_floating_ip.py b/plugins/modules/hcloud_floating_ip.py index 476147e..b6453bc 100644 --- a/plugins/modules/hcloud_floating_ip.py +++ b/plugins/modules/hcloud_floating_ip.py @@ -161,8 +161,8 @@ hcloud_floating_ip: mylabel: 123 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_floating_ip_info.py b/plugins/modules/hcloud_floating_ip_info.py index 79141a4..c0ec50b 100644 --- a/plugins/modules/hcloud_floating_ip_info.py +++ b/plugins/modules/hcloud_floating_ip_info.py @@ -94,8 +94,8 @@ hcloud_floating_ip_info: type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_image_info.py b/plugins/modules/hcloud_image_info.py index fb103de..48c1311 100644 --- a/plugins/modules/hcloud_image_info.py +++ b/plugins/modules/hcloud_image_info.py @@ -110,8 +110,8 @@ hcloud_image_info: type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_load_balancer.py b/plugins/modules/hcloud_load_balancer.py index 620fdd3..13d83d7 100644 --- a/plugins/modules/hcloud_load_balancer.py +++ b/plugins/modules/hcloud_load_balancer.py @@ -141,8 +141,8 @@ hcloud_load_balancer: sample: false """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_load_balancer_info.py b/plugins/modules/hcloud_load_balancer_info.py index 6beeacf..a3c5961 100644 --- a/plugins/modules/hcloud_load_balancer_info.py +++ b/plugins/modules/hcloud_load_balancer_info.py @@ -256,8 +256,8 @@ hcloud_load_balancer_info: sample: false """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_load_balancer_network.py b/plugins/modules/hcloud_load_balancer_network.py index 3c47e31..1c4e108 100644 --- a/plugins/modules/hcloud_load_balancer_network.py +++ b/plugins/modules/hcloud_load_balancer_network.py @@ -91,8 +91,8 @@ hcloud_load_balancer_network: sample: 10.0.0.8 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_load_balancer_service.py b/plugins/modules/hcloud_load_balancer_service.py index dd2dad2..93b97ed 100644 --- a/plugins/modules/hcloud_load_balancer_service.py +++ b/plugins/modules/hcloud_load_balancer_service.py @@ -279,8 +279,8 @@ hcloud_load_balancer_service: sample: false """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_load_balancer_target.py b/plugins/modules/hcloud_load_balancer_target.py index 3e89aa2..922e3fb 100644 --- a/plugins/modules/hcloud_load_balancer_target.py +++ b/plugins/modules/hcloud_load_balancer_target.py @@ -135,8 +135,8 @@ hcloud_load_balancer_target: returned: always """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_load_balancer_type_info.py b/plugins/modules/hcloud_load_balancer_type_info.py index 0530d49..390e34f 100644 --- a/plugins/modules/hcloud_load_balancer_type_info.py +++ b/plugins/modules/hcloud_load_balancer_type_info.py @@ -84,8 +84,8 @@ hcloud_load_balancer_type_info: sample: 5 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_location_info.py b/plugins/modules/hcloud_location_info.py index fc091a8..d230f7f 100644 --- a/plugins/modules/hcloud_location_info.py +++ b/plugins/modules/hcloud_location_info.py @@ -76,8 +76,8 @@ hcloud_location_info: sample: Falkenstein """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_network.py b/plugins/modules/hcloud_network.py index 1cc7eb2..2721abd 100644 --- a/plugins/modules/hcloud_network.py +++ b/plugins/modules/hcloud_network.py @@ -116,8 +116,8 @@ hcloud_network: mylabel: 123 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_network_info.py b/plugins/modules/hcloud_network_info.py index 8c65777..5cdfcdc 100644 --- a/plugins/modules/hcloud_network_info.py +++ b/plugins/modules/hcloud_network_info.py @@ -181,8 +181,8 @@ hcloud_network_info: type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_placement_group.py b/plugins/modules/hcloud_placement_group.py index eba71cc..9725702 100644 --- a/plugins/modules/hcloud_placement_group.py +++ b/plugins/modules/hcloud_placement_group.py @@ -107,8 +107,8 @@ hcloud_placement_group: - 4712 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_primary_ip.py b/plugins/modules/hcloud_primary_ip.py index 32605c1..9a6744d 100644 --- a/plugins/modules/hcloud_primary_ip.py +++ b/plugins/modules/hcloud_primary_ip.py @@ -131,8 +131,8 @@ hcloud_primary_ip: mylabel: 123 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_primary_ip_info.py b/plugins/modules/hcloud_primary_ip_info.py index 8be7397..6130f39 100644 --- a/plugins/modules/hcloud_primary_ip_info.py +++ b/plugins/modules/hcloud_primary_ip_info.py @@ -117,8 +117,8 @@ hcloud_primary_ip_info: type: bool """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_rdns.py b/plugins/modules/hcloud_rdns.py index f559a4e..45ccec0 100644 --- a/plugins/modules/hcloud_rdns.py +++ b/plugins/modules/hcloud_rdns.py @@ -134,8 +134,8 @@ hcloud_rdns: sample: example.com """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.ansible.netcommon.plugins.module_utils.network.common import ( utils, ) diff --git a/plugins/modules/hcloud_route.py b/plugins/modules/hcloud_route.py index 5a77787..c922a02 100644 --- a/plugins/modules/hcloud_route.py +++ b/plugins/modules/hcloud_route.py @@ -87,8 +87,8 @@ hcloud_route: sample: 10.0.0.1 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_server.py b/plugins/modules/hcloud_server.py index 1843bdc..555323c 100644 --- a/plugins/modules/hcloud_server.py +++ b/plugins/modules/hcloud_server.py @@ -330,8 +330,8 @@ hcloud_server: from datetime import datetime, timedelta, timezone -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_server_info.py b/plugins/modules/hcloud_server_info.py index 6087d84..ee3d3fe 100644 --- a/plugins/modules/hcloud_server_info.py +++ b/plugins/modules/hcloud_server_info.py @@ -139,8 +139,8 @@ hcloud_server_info: version_added: "0.1.0" """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_server_network.py b/plugins/modules/hcloud_server_network.py index 33b562a..3d185e9 100644 --- a/plugins/modules/hcloud_server_network.py +++ b/plugins/modules/hcloud_server_network.py @@ -111,8 +111,8 @@ hcloud_server_network: sample: [10.1.0.1, ...] """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_server_type_info.py b/plugins/modules/hcloud_server_type_info.py index 34703da..866eb7f 100644 --- a/plugins/modules/hcloud_server_type_info.py +++ b/plugins/modules/hcloud_server_type_info.py @@ -122,8 +122,8 @@ hcloud_server_type_info: """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_ssh_key.py b/plugins/modules/hcloud_ssh_key.py index cbcdeee..03ccf69 100644 --- a/plugins/modules/hcloud_ssh_key.py +++ b/plugins/modules/hcloud_ssh_key.py @@ -110,8 +110,8 @@ hcloud_ssh_key: mylabel: 123 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_ssh_key_info.py b/plugins/modules/hcloud_ssh_key_info.py index 31ea15f..757fd8c 100644 --- a/plugins/modules/hcloud_ssh_key_info.py +++ b/plugins/modules/hcloud_ssh_key_info.py @@ -76,8 +76,8 @@ hcloud_ssh_key_info: returned: always type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_subnetwork.py b/plugins/modules/hcloud_subnetwork.py index 4e77db6..53f6d6d 100644 --- a/plugins/modules/hcloud_subnetwork.py +++ b/plugins/modules/hcloud_subnetwork.py @@ -124,8 +124,8 @@ hcloud_subnetwork: sample: 10.0.0.1 """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud try: diff --git a/plugins/modules/hcloud_volume.py b/plugins/modules/hcloud_volume.py index 3377b7c..af75d02 100644 --- a/plugins/modules/hcloud_volume.py +++ b/plugins/modules/hcloud_volume.py @@ -157,8 +157,8 @@ hcloud_volume: version_added: "0.1.0" """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud diff --git a/plugins/modules/hcloud_volume_info.py b/plugins/modules/hcloud_volume_info.py index dd7fc89..01dc31a 100644 --- a/plugins/modules/hcloud_volume_info.py +++ b/plugins/modules/hcloud_volume_info.py @@ -91,8 +91,8 @@ hcloud_volume_info: type: dict """ -from ansible.module_utils._text import to_native from ansible.module_utils.basic import AnsibleModule +from ansible.module_utils.common.text.converters import to_native from ansible_collections.hetzner.hcloud.plugins.module_utils.hcloud import Hcloud