[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 06/15] Only log storage to tty3 if we have permission to do so.



One small step in the direction of being able to run the test suite as a
non-root user.
---
 pyanaconda/storage/storage_log.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/storage_log.py b/pyanaconda/storage/storage_log.py
index 79981a8..56cd8e3 100644
--- a/pyanaconda/storage/storage_log.py
+++ b/pyanaconda/storage/storage_log.py
@@ -1,5 +1,6 @@
 import logging
 from pyanaconda import anaconda_log
+import os
 import inspect
 
 def log_method_call(d, *args, **kwargs):
@@ -25,7 +26,8 @@ def log_method_call(d, *args, **kwargs):
 logger = logging.getLogger("storage")
 logger.setLevel(logging.DEBUG)
 anaconda_log.logger.addFileHandler("/tmp/storage.log", logger, logging.DEBUG)
-anaconda_log.logger.addFileHandler("/dev/tty3", logger,
+if os.access(anaconda_log.MAIN_LOG_TTY, os.W_OK):
+    anaconda_log.logger.addFileHandler(anaconda_log.MAIN_LOG_TTY, logger,
                                    anaconda_log.DEFAULT_TTY_LEVEL,
                                    anaconda_log.TTY_FORMAT,
                                    autoLevel=True)
-- 
1.7.2.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]