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:
parent
16654bfa3e
commit
abb5a104d9
1 changed files with 2 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue