From 4f1746ee1d4bd15af390e8bc7bf3f9c67163455a Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 24 Jul 2018 16:27:17 +0530 Subject: [PATCH] vault: check dir value before passing (#43184) This fix checks if dirname is not equal to '' before proceeding to create actual directory with name. Signed-off-by: Abhijeet Kasurde --- lib/ansible/parsing/vault/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/parsing/vault/__init__.py b/lib/ansible/parsing/vault/__init__.py index 3ac539df9aa..6e717240507 100644 --- a/lib/ansible/parsing/vault/__init__.py +++ b/lib/ansible/parsing/vault/__init__.py @@ -927,7 +927,7 @@ class VaultEditor: """ create a new encrypted file """ dirname = os.path.dirname(filename) - if not os.path.exists(dirname): + if dirname and not os.path.exists(dirname): display.warning("%s does not exist, creating..." % dirname) makedirs_safe(dirname)