diff --git a/library/ipasssd.py b/library/ipasssd.py index 3b2a567f1c17a7d549087ca39ecfcd6c7073f28a..4320a6bc44f309d768b02359af5fb346c6eb79ae 100644 --- a/library/ipasssd.py +++ b/library/ipasssd.py @@ -201,8 +201,8 @@ def main(): if on_master: sssd_enable_service(module, sssdconfig, 'ifp') - if (("ssh" in services and file_exists(paths.SSH_CONFIG)) or - ("sshd" in services and file_exists(paths.SSHD_CONFIG))): + if (("ssh" in services and os.path.isfile(paths.SSH_CONFIG)) or + ("sshd" in services and os.path.isfile(paths.SSHD_CONFIG))): sssd_enable_service(module, sssdconfig, 'ssh') if "sudo" in services: diff --git a/module_utils/ansible_ipa_client.py b/module_utils/ansible_ipa_client.py index 2e58d1b3b77033912379668d729c347688e1329d..0839770c4731e8c195726ebbe3035a57df521c4e 100644 --- a/module_utils/ansible_ipa_client.py +++ b/module_utils/ansible_ipa_client.py @@ -69,7 +69,7 @@ if NUM_VERSION >= 40400: if NUM_VERSION >= 40500 and NUM_VERSION < 40590: from cryptography.hazmat.primitives import serialization from ipapython.ipautil import CalledProcessError, write_tmp_file, \ - ipa_generate_password, file_exists + ipa_generate_password from ipapython.dn import DN try: from ipalib.install.kinit import kinit_keytab, kinit_password diff --git a/roles/ipaserver/library/ipaserver_load_cache.py b/roles/ipaserver/library/ipaserver_load_cache.py index ae805d3f2cdce81f00534fad977e5ccdb4d09ea6..1c5fa7f0d5f788990d57dadeab14f48c0d2e194d 100644 --- a/roles/ipaserver/library/ipaserver_load_cache.py +++ b/roles/ipaserver/library/ipaserver_load_cache.py @@ -68,7 +68,7 @@ def main(): # restore cache ######################################################### - if ipautil.file_exists(paths.ROOT_IPA_CACHE): + if os.path.isfile(paths.ROOT_IPA_CACHE): if options.dm_password is None: ansible_module.fail_json(msg="Directory Manager password required") try: diff --git a/roles/ipaserver/library/ipaserver_test.py b/roles/ipaserver/library/ipaserver_test.py index 5d96b19054ad58e598a42347a74dadb9336ff70e..975df0da1f0814bcbed5715e6726860ba86797a6 100644 --- a/roles/ipaserver/library/ipaserver_test.py +++ b/roles/ipaserver/library/ipaserver_test.py @@ -399,7 +399,7 @@ def main(): msg="servers cannot be used without providing domain") else: - if not ipautil.file_exists(options.replica_file): + if not os.path.isfile(options.replica_file): ansible_module.fail_json( msg="Replica file %s does not exist" % options.replica_file)