[PATCH] Do not attempt to run authconfig if it doesn't exist.

Chris Lumens clumens at redhat.com
Fri Mar 21 13:52:13 UTC 2014


While I'm at it, don't force installation of authconfig and firewalld.  These
are defined as default packages in the core group, which means that for all
interactive users they will always be installed.  This is true for almost all
kickstart users too.  The only ones who will be affected are those who either
specifically remove these packages themselves or use --nocore.  Those people
don't want the package to exist anyway.
---
 pyanaconda/install.py   | 2 +-
 pyanaconda/kickstart.py | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/install.py b/pyanaconda/install.py
index ffaeab2..be2e1a5 100644
--- a/pyanaconda/install.py
+++ b/pyanaconda/install.py
@@ -155,7 +155,7 @@ def doInstall(storage, payload, ksdata, instClass):
     # anaconda requires storage packages in order to make sure the target
     # system is bootable and configurable, and some other packages in order
     # to finish setting up the system.
-    packages = storage.packages + ["authconfig", "firewalld"] + ksdata.realm.packages
+    packages = storage.packages + ksdata.realm.packages
     if not ksdata.bootloader.disabled:
         packages += storage.bootloader.packages
 
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 53c6d6f..51f77d3 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -229,6 +229,10 @@ def getAvailableDiskSpace(storage):
 
 class Authconfig(commands.authconfig.FC3_Authconfig):
     def execute(self, *args):
+        cmd = "/usr/sbin/authconfig"
+        if not os.path.exists(ROOT_PATH+cmd):
+            return
+
         args = ["--update", "--nostart"] + shlex.split(self.authconfig)
 
         if not flags.automatedInstall and \
@@ -237,9 +241,9 @@ class Authconfig(commands.authconfig.FC3_Authconfig):
             args += ["--enablefingerprint"]
 
         try:
-            iutil.execWithRedirect("/usr/sbin/authconfig", args, root=ROOT_PATH)
+            iutil.execWithRedirect(cmd, args, root=ROOT_PATH)
         except RuntimeError as msg:
-            log.error("Error running /usr/sbin/authconfig %s: %s", args, msg)
+            log.error("Error running %s %s: %s", cmd, args, msg)
 
 class AutoPart(commands.autopart.F20_AutoPart):
     def execute(self, storage, ksdata, instClass):
-- 
1.8.3.1



More information about the anaconda-patches mailing list