ansible_freeipa_module: Add ansible module argument to valid_creds function

For debug and error reporting it is needed to have the ansible module also
in the valid_creds function.
This commit is contained in:
Thomas Woerner
2019-08-12 18:33:34 +02:00
parent 455ca83ef5
commit c69d0bc53f
4 changed files with 5 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ from ipaplatform.paths import paths
from ipalib.krb_utils import get_credentials_if_valid
def valid_creds(principal):
def valid_creds(module, principal):
"""
Get valid credintials matching the princial
"""
@@ -110,7 +110,7 @@ def execute_api_command(module, principal, password, command, name, args):
ccache_dir = None
ccache_name = None
try:
if not valid_creds(principal):
if not valid_creds(module, principal):
ccache_dir, ccache_name = temp_kinit(principal, password)
api_connect()

View File

@@ -272,7 +272,7 @@ def main():
ccache_dir = None
ccache_name = None
try:
if not valid_creds(ipaadmin_principal):
if not valid_creds(ansible_module, ipaadmin_principal):
ccache_dir, ccache_name = temp_kinit(ipaadmin_principal,
ipaadmin_password)
api_connect()

View File

@@ -217,7 +217,7 @@ def main():
ccache_dir = None
ccache_name = None
try:
if not valid_creds(ipaadmin_principal):
if not valid_creds(ansible_module, ipaadmin_principal):
ccache_dir, ccache_name = temp_kinit(ipaadmin_principal,
ipaadmin_password)
api_connect()

View File

@@ -353,7 +353,7 @@ def main():
ccache_dir = None
ccache_name = None
try:
if not valid_creds(ipaadmin_principal):
if not valid_creds(ansible_module, ipaadmin_principal):
ccache_dir, ccache_name = temp_kinit(ipaadmin_principal,
ipaadmin_password)
api_connect()