Skip to content
Snippets Groups Projects
Unverified Commit 2cb11d44 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman Committed by GitHub
Browse files

Merge pull request #729 from t-woerner/fix_new_ansible_test_findings

ansible-test: Fix new findings
parents 7632f90e 9499a3ed
No related branches found
No related tags found
No related merge requests found
...@@ -393,8 +393,8 @@ def main(): ...@@ -393,8 +393,8 @@ def main():
ansible_log.info("Disabled p11-kit-proxy") ansible_log.info("Disabled p11-kit-proxy")
except (RuntimeError, ValueError, ScriptError, except (RuntimeError, ValueError, ScriptError,
ipautil.CalledProcessError) as e: ipautil.CalledProcessError) as err:
ansible_module.fail_json(msg=str(e)) ansible_module.fail_json(msg=str(err))
ansible_module.exit_json( ansible_module.exit_json(
changed=True, changed=True,
......
...@@ -330,9 +330,9 @@ else: ...@@ -330,9 +330,9 @@ else:
_no_hbac_allow, dirsrv_pkcs12_info, no_pkinit): _no_hbac_allow, dirsrv_pkcs12_info, no_pkinit):
if not options.external_cert_files: if not options.external_cert_files:
ds = dsinstance.DsInstance(fstore=fstore, domainlevel=domainlevel, _ds = dsinstance.DsInstance(fstore=fstore, domainlevel=domainlevel,
config_ldif=dirsrv_config_file) config_ldif=dirsrv_config_file)
ds.set_output(ansible_log) _ds.set_output(ansible_log)
if options.dirsrv_cert_files: if options.dirsrv_cert_files:
_dirsrv_pkcs12_info = dirsrv_pkcs12_info _dirsrv_pkcs12_info = dirsrv_pkcs12_info
...@@ -340,30 +340,30 @@ else: ...@@ -340,30 +340,30 @@ else:
_dirsrv_pkcs12_info = None _dirsrv_pkcs12_info = None
with redirect_stdout(ansible_log): with redirect_stdout(ansible_log):
ds.init_info(realm_name, host_name, domain_name, dm_password, _ds.init_info(realm_name, host_name, domain_name, dm_password,
subject_base, ca_subject, idstart, idmax, subject_base, ca_subject, idstart, idmax,
# hbac_allow=not no_hbac_allow, # hbac_allow=not no_hbac_allow,
_dirsrv_pkcs12_info, setup_pkinit=not no_pkinit) _dirsrv_pkcs12_info, setup_pkinit=not no_pkinit)
else: else:
ds = dsinstance.DsInstance(fstore=fstore, domainlevel=domainlevel) _ds = dsinstance.DsInstance(fstore=fstore, domainlevel=domainlevel)
ds.set_output(ansible_log) _ds.set_output(ansible_log)
with redirect_stdout(ansible_log): with redirect_stdout(ansible_log):
ds.init_info(realm_name, host_name, domain_name, dm_password, _ds.init_info(realm_name, host_name, domain_name, dm_password,
subject_base, ca_subject, 1101, 1100, None, subject_base, ca_subject, 1101, 1100, None,
setup_pkinit=not no_pkinit) setup_pkinit=not no_pkinit)
return ds return _ds
def ansible_module_get_parsed_ip_addresses(ansible_module, def ansible_module_get_parsed_ip_addresses(ansible_module,
param='ip_addresses'): param='ip_addresses'):
ip_addrs = [] ip_addrs = []
for ip in ansible_module.params.get(param): for _ip in ansible_module.params.get(param):
try: try:
ip_parsed = ipautil.CheckedIPAddress(ip) ip_parsed = ipautil.CheckedIPAddress(_ip)
except Exception as e: except Exception as err:
ansible_module.fail_json( ansible_module.fail_json(
msg="Invalid IP Address %s: %s" % (ip, e)) msg="Invalid IP Address %s: %s" % (_ip, err))
ip_addrs.append(ip_parsed) ip_addrs.append(ip_parsed)
return ip_addrs return ip_addrs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment