Title: #1183: [Backport][ipa-4-6] Use os.path.isfile() and isdir()
This PR was opened automatically because PR #1182 was pushed to master and backport to
ipa-4-6 is required.
To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1183/head:pr1183
git checkout pr1183