mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-08 06:13:21 +00:00
Made code flake8 friendly
This commit is contained in:
@@ -97,11 +97,10 @@ RETURN = """
|
||||
"""
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils.ansible_freeipa_module import temp_kinit, \
|
||||
temp_kdestroy, valid_creds, api_connect, api_command, \
|
||||
temp_kdestroy, valid_creds, api_connect, \
|
||||
api_command_no_name, compare_args_ipa, module_params_get, \
|
||||
gen_add_del_lists, is_ipv4_addr, is_ipv6_addr, ipalib_errors
|
||||
is_ipv4_addr, is_ipv6_addr
|
||||
|
||||
|
||||
def find_dnsconfig(module):
|
||||
|
||||
@@ -221,7 +221,10 @@ def main():
|
||||
# Get parameters
|
||||
|
||||
# general
|
||||
ipaadmin_principal = module_params_get(ansible_module, "ipaadmin_principal")
|
||||
ipaadmin_principal = module_params_get(
|
||||
ansible_module,
|
||||
"ipaadmin_principal",
|
||||
)
|
||||
ipaadmin_password = module_params_get(ansible_module, "ipaadmin_password")
|
||||
names = module_params_get(ansible_module, "name")
|
||||
|
||||
|
||||
@@ -875,9 +875,11 @@ def main():
|
||||
res_find_dnsrecord = find_dnsrecord(ansible_module, name)
|
||||
except ipalib_errors.NotFound as e:
|
||||
msg = str(e)
|
||||
if ip_address is None and \
|
||||
("DNS is not configured" in msg or \
|
||||
"DNS zone not found" in msg):
|
||||
dns_not_configured = "DNS is not configured" in msg
|
||||
dns_zone_not_found = "DNS zone not found" in msg
|
||||
if ip_address is None and (
|
||||
dns_not_configured or dns_zone_not_found
|
||||
):
|
||||
# IP address(es) not given and no DNS support in IPA
|
||||
# -> Ignore failure
|
||||
# IP address(es) not given and DNS zone is not found
|
||||
|
||||
@@ -655,9 +655,9 @@ def check_parameters(module, state, action,
|
||||
|
||||
def extend_emails(email, default_email_domain):
|
||||
if email is not None:
|
||||
return [ "%s@%s" % (_email, default_email_domain)
|
||||
if "@" not in _email else _email
|
||||
for _email in email]
|
||||
return ["%s@%s" % (_email, default_email_domain)
|
||||
if "@" not in _email else _email
|
||||
for _email in email]
|
||||
return email
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user