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>
This commit is contained in:
parent
bc9a40b32d
commit
4f1746ee1d
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue