summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamian Johnson <atagar@torproject.org>2017-12-04 11:59:35 -0800
committerDamian Johnson <atagar@torproject.org>2017-12-04 11:59:35 -0800
commit1e0f9a12728e5fbeaa9e9026ee542e8944a04930 (patch)
tree1606293b66a6b75cd38e5bc11b23fd280ad593c6
parentc0276f9efa672dedff6322f04fab4bcb879b2174 (diff)
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.
-rw-r--r--nyx/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/nyx/__init__.py b/nyx/__init__.py
index 256764f..408681c 100644
--- a/nyx/__init__.py
+++ b/nyx/__init__.py
@@ -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)