diff options
author | John Estabrook <jestabro@vyos.io> | 2024-08-15 13:29:21 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2024-08-15 13:58:44 -0500 |
commit | 58125b64c6678ea581998c9f83a19fae0cdbda12 (patch) | |
tree | d58a209d3c3b155a254f81dfd302164f6604192d /python | |
parent | ada962d9e458ed47d7c20537496305f20fc2b3f8 (diff) | |
download | vyos-1x-58125b64c6678ea581998c9f83a19fae0cdbda12.tar.gz vyos-1x-58125b64c6678ea581998c9f83a19fae0cdbda12.zip |
utils: T6658: fix write_file check in case of empty directory path
Diffstat (limited to 'python')
-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) |