mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user