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 <akasurde@redhat.com>
pull/43198/head
Abhijeet Kasurde 6 years ago committed by GitHub
parent bc9a40b32d
commit 4f1746ee1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save