mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
refactor: move module vars out of __init__ (#336)
##### SUMMARY - move module vars out of `__init__` - add modules type hints - catch hcloud exception for api calls
This commit is contained in:
parent
4ae557c287
commit
94190ae6cb
33 changed files with 250 additions and 132 deletions
|
|
@ -274,17 +274,20 @@ hcloud_load_balancer_info:
|
|||
sample: false
|
||||
"""
|
||||
|
||||
from typing import List, Optional
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.common.text.converters import to_native
|
||||
|
||||
from ..module_utils.hcloud import AnsibleHCloud
|
||||
from ..module_utils.vendor.hcloud import HCloudException
|
||||
from ..module_utils.vendor.hcloud.load_balancers import BoundLoadBalancer
|
||||
|
||||
|
||||
class AnsibleHCloudLoadBalancerInfo(AnsibleHCloud):
|
||||
def __init__(self, module):
|
||||
super().__init__(module, "hcloud_load_balancer_info")
|
||||
self.hcloud_load_balancer_info = None
|
||||
represent = "hcloud_load_balancer_info"
|
||||
|
||||
hcloud_load_balancer_info: Optional[List[BoundLoadBalancer]] = None
|
||||
|
||||
def _prepare_result(self):
|
||||
tmp = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue