diff options
| author | 2022-02-17 12:34:41 +0100 | |
|---|---|---|
| committer | 2022-02-19 00:36:49 +0000 | |
| commit | af3bff6382fe4c1ca97e1f8ce1a93ed37308e387 (patch) | |
| tree | e9505d64b7db1e1faca2808b3955ecff7d746ab6 /mini-dinstall | |
| parent | a19c44d563606ddbd11a82bd8e444461eb1582e4 (diff) | |
mini-dinstall: Log mkdir errors instead of just printing them
The use of `print` to report errors occurred during the creation of
directories does not leave any trace in the logs, making post-facto
analysis of failures much harder.
Let's instead use the same logging mechanism used for other errors.
Diffstat (limited to 'mini-dinstall')
| -rwxr-xr-x | mini-dinstall | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mini-dinstall b/mini-dinstall index e6e1225..218365c 100755 --- a/mini-dinstall +++ b/mini-dinstall @@ -185,10 +185,11 @@ def do_and_log(msg, function, *args): def do_mkdir(name): if os.access(name, os.X_OK): return + try: do_and_log('Creating directory "%s"' % name, os.mkdir, name) except OSError as e: - print(e) + logger.error(e) exit(1) def do_rename(source, target): |
