1
0
Fork 0

Fix logging to file in the current directory

Previously if you ran 'tuned -l log', it would crash with:
OSError: [Errno 2] No such file or directory: ''
This patch fixes the bug.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2017-02-16 09:38:42 +01:00
parent 16654bfa3e
commit abb5a104d9

View file

@ -74,6 +74,8 @@ class TunedLogger(logging.getLoggerClass()):
return
log_directory = os.path.dirname(filename)
if log_directory == '':
log_directory = '.'
if not os.path.exists(log_directory):
os.makedirs(log_directory)