Skip to content
Snippets Groups Projects
Commit 1e0f9a12 authored by Damian Johnson's avatar Damian Johnson
Browse files

Reduce runlevel of message about lacking cache write access

When nyx is run as a user without a home directory or one we can't write to
users get a notice...

  https://trac.torproject.org/projects/tor/ticket/24508

This is fine. If we can't make our cache we already disable it.
parent c0276f9e
Branches
Tags
No related merge requests found
......@@ -339,7 +339,8 @@ def data_directory(filename, config):
try:
os.makedirs(data_dir)
except OSError as exc:
stem.util.log.log_once('nyx.data_directory_unavailable', stem.util.log.NOTICE, 'Unable to create a data directory at %s (%s). This is fine, but caching is disabled meaning performance will be diminished a bit.' % (data_dir, exc))
msg_runlevel = stem.util.log.INFO if 'Permission denied' in str(exc) else stem.util.log.NOTICE
stem.util.log.log_once('nyx.data_directory_unavailable', msg_runlevel, 'Unable to create a data directory at %s (%s). This is fine, but caching is disabled meaning performance will be diminished a bit.' % (data_dir, exc))
return None
return os.path.join(data_dir, filename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment