[anaconda 2/6] Skip syslog for dirinstall

Brian C. Lane bcl at redhat.com
Wed Aug 6 19:22:56 UTC 2014


This also moves the imageInstall and dirInstall flag setting to before
logging is imported since the syslog handling depends on them.
---
 anaconda                   | 8 +++++---
 pyanaconda/anaconda_log.py | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/anaconda b/anaconda
index 4d4676e..b4dddc9 100755
--- a/anaconda
+++ b/anaconda
@@ -916,6 +916,11 @@ if __name__ == "__main__":
     from pyanaconda.flags import flags, can_touch_runtime_system
     (opts, depr) = parseArguments(boot_cmdline=flags.cmdline)
 
+    if opts.images:
+        flags.imageInstall = True
+    elif opts.dirinstall:
+        flags.dirInstall = True
+
     # Set up logging as early as possible.
     import logging
     from pyanaconda import anaconda_log
@@ -963,10 +968,7 @@ if __name__ == "__main__":
     if opts.images and opts.dirinstall:
         stdoutLog.error("--images and --dirinstall cannot be used at the same time")
         sys.exit(1)
-    elif opts.images:
-        flags.imageInstall = True
     elif opts.dirinstall:
-        flags.dirInstall = True
         if opts.dirinstall is True:
             root_path = os.environ.get("ANACONDA_ROOT_PATH", "/mnt/sysimage")
         else:
diff --git a/pyanaconda/anaconda_log.py b/pyanaconda/anaconda_log.py
index f7e36a5..5c7b78b 100644
--- a/pyanaconda/anaconda_log.py
+++ b/pyanaconda/anaconda_log.py
@@ -194,7 +194,7 @@ class AnacondaLog:
     def forwardToSyslog(self, logr):
         """Forward everything that goes in the logger to the syslog daemon.
         """
-        if flags.imageInstall:
+        if flags.imageInstall or flags.dirInstall:
             # don't clutter up the system logs when doing an image install
             return
 
-- 
1.9.3



More information about the anaconda-patches mailing list