mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-22 19:59:07 +00:00
move imports from functions to the top of the file (#11396)
* move imports from functions to the top of the file * add changelog frag * Apply suggestions from code review Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
defd15609c
commit
c8356981bb
7 changed files with 21 additions and 27 deletions
|
|
@ -231,6 +231,9 @@ roles:
|
|||
"""
|
||||
|
||||
import os
|
||||
import time
|
||||
from collections import namedtuple
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.urls import open_url
|
||||
|
||||
|
|
@ -396,8 +399,6 @@ def create_service(module, auth, template_id, service_name, custom_attrs, unique
|
|||
|
||||
|
||||
def wait_for_service_to_become_ready(module, auth, service_id, wait_timeout):
|
||||
import time
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
while (time.time() - start_time) < wait_timeout:
|
||||
|
|
@ -729,8 +730,6 @@ def get_connection_info(module):
|
|||
module.fail_json(
|
||||
msg="One or more connection parameters (api_url, api_username, api_password) were not specified"
|
||||
)
|
||||
from collections import namedtuple
|
||||
|
||||
auth_params = namedtuple("auth", ("url", "user", "password"))
|
||||
|
||||
return auth_params(url=url, user=username, password=password)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue