diff options
author | John Estabrook <jestabro@vyos.io> | 2024-08-15 13:29:21 -0500 |
---|---|---|
committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-16 05:59:28 +0000 |
commit | ad897231ab39fd6f6a17ad2d90e181b6d36095da (patch) | |
tree | e7abd86dea573a018f1e423c52c0b907b29337a6 | |
parent | 1ffdf48642e454d7f9ddead8d79f19b96dea00d4 (diff) | |
download | vyos-1x-mergify/bp/circinus/pr-3989.tar.gz vyos-1x-mergify/bp/circinus/pr-3989.zip |
utils: T6658: fix write_file check in case of empty directory pathmergify/bp/circinus/pr-3989
(cherry picked from commit 58125b64c6678ea581998c9f83a19fae0cdbda12)
-rw-r--r-- | python/vyos/utils/file.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py index c566f0334..eaebb57a3 100644 --- a/python/vyos/utils/file.py +++ b/python/vyos/utils/file.py @@ -51,7 +51,7 @@ def write_file(fname, data, defaultonfailure=None, user=None, group=None, mode=N If directory of file is not present, it is auto-created. """ dirname = os.path.dirname(fname) - if not os.path.isdir(dirname): + if dirname and not os.path.isdir(dirname): os.makedirs(dirname, mode=0o755, exist_ok=False) chown(dirname, user, group) |