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

library/ipajoin.py: Enhanced tests for password and keytab

mutually_exclusive and required_one_of are only able to check if the parameters
are defined, but not if they are set to "".
parent bf64c0bb
No related branches found
No related tags found
No related merge requests found
......@@ -202,8 +202,6 @@ def main():
kinit_attempts=dict(required=False, type='int', default=5),
debug=dict(required=False, type='bool'),
),
mutually_exclusive = [['password','keytab']],
required_one_of = [['password', 'keytab']],
supports_check_mode = True,
)
......@@ -222,6 +220,10 @@ def main():
kinit_attempts = module.params.get('kinit_attempts')
debug = module.params.get('debug')
if password is not None and password != "" and \
keytab is not None and keytab != "":
module.fail_json(msg="Password and keytab cannot be used together")
client_domain = hostname[hostname.find(".")+1:]
nolog = tuple()
env = {'PATH': SECURE_PATH}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment