Skip to content

Commit

Permalink
vault: check dir value before passing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akasurde committed Jul 24, 2018
1 parent c6854fd commit 2de9b0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/parsing/vault/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ def create_file(self, filename, secret, vault_id=None):
""" 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)

Expand Down

0 comments on commit 2de9b0d

Please sign in to comment.