1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

refactor: no direct module access

This commit is contained in:
jo 2025-12-16 15:55:24 +01:00
parent 07c1a497c6
commit 3b3990d8e0
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
2 changed files with 4 additions and 6 deletions

View file

@ -338,8 +338,7 @@ class AnsibleFloatingIP(AnsibleHCloud):
def main():
module = AnsibleFloatingIP.define_module()
o = AnsibleFloatingIP(module)
o = AnsibleFloatingIP(AnsibleFloatingIP.define_module())
match o.module.params["state"]:
case "absent":
@ -350,7 +349,7 @@ def main():
result = o.get_result()
result["hcloud_floating_ip"] = result.pop(o.represent)
module.exit_json(**result)
o.module.exit_json(**result)
if __name__ == "__main__":

View file

@ -305,8 +305,7 @@ class AnsiblePrimaryIP(AnsibleHCloud):
def main():
module = AnsiblePrimaryIP.define_module()
o = AnsiblePrimaryIP(module)
o = AnsiblePrimaryIP(AnsiblePrimaryIP.define_module())
match o.module.params["state"]:
case "absent":
@ -317,7 +316,7 @@ def main():
result = o.get_result()
result["hcloud_primary_ip"] = result.pop(o.represent)
module.exit_json(**result)
o.module.exit_json(**result)
if __name__ == "__main__":