Skip to content
Snippets Groups Projects
Commit 0af208d2 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

Replace asserts with raise AssertionError

This patch is needed to pass Automation Hub tests.
parent 10b16a3b
No related branches found
No related tags found
No related merge requests found
...@@ -288,7 +288,8 @@ def gen_args_smb(netbiosname, ok_as_delegate, ok_to_auth_as_delegate): ...@@ -288,7 +288,8 @@ def gen_args_smb(netbiosname, ok_as_delegate, ok_to_auth_as_delegate):
def check_parameters(module, state, action, names, parameters): def check_parameters(module, state, action, names, parameters):
assert isinstance(parameters, dict) if not isinstance(parameters, dict):
raise AssertionError("parameters is not a dict")
# invalid parameters for everything but state 'present', action 'service'. # invalid parameters for everything but state 'present', action 'service'.
invalid = ['pac_type', 'auth_ind', 'skip_host_check', invalid = ['pac_type', 'auth_ind', 'skip_host_check',
......
...@@ -84,7 +84,8 @@ def is_dogtag_configured(subsystem): ...@@ -84,7 +84,8 @@ def is_dogtag_configured(subsystem):
# ca / kra is configured when the directory # ca / kra is configured when the directory
# /var/lib/pki/pki-tomcat/[ca|kra] # exists # /var/lib/pki/pki-tomcat/[ca|kra] # exists
available_subsystems = {'ca', 'kra'} available_subsystems = {'ca', 'kra'}
assert subsystem in available_subsystems if subsystem not in available_subsystems:
raise AssertionError("Subsystem '%s' not available" % subsystem)
return os.path.isdir(os.path.join(VAR_LIB_PKI_TOMCAT, subsystem)) return os.path.isdir(os.path.join(VAR_LIB_PKI_TOMCAT, subsystem))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment