From f55481863d320e7ec5a8c2a0d273dfa0a07b8d7f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 20 Dec 2018 17:47:26 +0100 Subject: [PATCH] Prevent error if module.params['path'] has no path included. (#50106) --- lib/ansible/modules/crypto/openssh_keypair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/crypto/openssh_keypair.py b/lib/ansible/modules/crypto/openssh_keypair.py index cfb3e14e2cf..ad0e2f3eac4 100644 --- a/lib/ansible/modules/crypto/openssh_keypair.py +++ b/lib/ansible/modules/crypto/openssh_keypair.py @@ -272,7 +272,7 @@ def main(): ) # Check if Path exists - base_dir = os.path.dirname(module.params['path']) + base_dir = os.path.dirname(module.params['path']) or '.' if not os.path.isdir(base_dir): module.fail_json( name=base_dir,