[PATCH 1/3] Only try logging to tty3 if we have permission to do so.

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

 



It should be possible to import this module as non-root, which this
patch makes possible.
---
 pyanaconda/network.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index 9cad759..9b5f197 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -55,10 +55,11 @@ from pyanaconda import anaconda_log
 logger = logging.getLogger("ifcfg")
 logger.setLevel(logging.DEBUG)
 anaconda_log.logger.addFileHandler(ifcfgLogFile, logger, logging.DEBUG)
-anaconda_log.logger.addFileHandler("/dev/tty3", logger,
-                                   anaconda_log.DEFAULT_TTY_LEVEL,
-                                   anaconda_log.TTY_FORMAT,
-                                   autoLevel=True)
+if os.access("/dev/tty3", os.W_OK):
+    anaconda_log.logger.addFileHandler("/dev/tty3", logger,
+                                       anaconda_log.DEFAULT_TTY_LEVEL,
+                                       anaconda_log.TTY_FORMAT,
+                                       autoLevel=True)
 anaconda_log.logger.forwardToSyslog(logger)
 
 ifcfglog = logging.getLogger("ifcfg")
-- 
1.7.3.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux