diff options
author | Chris Lumens <clumens@redhat.com> | 2005-08-29 20:49:55 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2005-08-29 20:49:55 +0000 |
commit | 4c7abe447d798b9191fc7446687206fb189e680e (patch) | |
tree | 6187ad4fa17bdb9ad75d1b7af2355e0ac98f6ba6 /instdata.py | |
parent | 19dd52d5196dc1185c9a621e8e68769b78e1dfbe (diff) | |
download | anaconda-4c7abe447d798b9191fc7446687206fb189e680e.tar.gz anaconda-4c7abe447d798b9191fc7446687206fb189e680e.tar.xz anaconda-4c7abe447d798b9191fc7446687206fb189e680e.zip |
Simplified the authconfig step to store data as a string to be passed to
authconfig in its entirety, rather than handling it as a series of
arguments we need to process. We weren't really doing anything with it
anyway.
Diffstat (limited to 'instdata.py')
-rw-r--r-- | instdata.py | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/instdata.py b/instdata.py index a24a13b76..d478a3457 100644 --- a/instdata.py +++ b/instdata.py @@ -29,6 +29,7 @@ import partedUtils import hdrlist import zfcp import urllib +import iutil from flags import * from constants import * @@ -54,7 +55,7 @@ class InstallData: self.timezone = timezone.Timezone() self.accounts = users.Accounts() self.rootPassword = users.RootPassword () - self.auth = users.Authentication() + self.auth = "" self.desktop = desktop.Desktop() self.grpset = None self.upgrade = False @@ -107,19 +108,41 @@ class InstallData: self.upgrade = bool def write(self, instPath): + if self.auth.find("--enablemd5"): + useMD5 = True + else: + useMD5 = False + self.instLanguage.write (instPath) if not self.isHeadless: self.keyboard.write (instPath) self.timezone.write (instPath) - self.auth.write (instPath) + + try: + if flags.setupFilesystems: + args = ["--kickstart", "--nostart", self.auth] + iutil.execWithRedirect("/usr/sbin/authconfig", args, + stdout = None, stderr = None, + searchPath = 1, root = instPath) + else: + log.error("Would have run: /usr/sbin/authconfig %s", args) + except RuntimeError, msg: + log.error("Error running /usr/sbin/authconfig %s: %s", + args, msg) + self.firewall.write (instPath) self.security.write (instPath) - self.rootPassword.write (instPath, self.auth) - self.accounts.write (instPath, self.auth) + self.rootPassword.write (instPath, useMD5) + self.accounts.write (instPath, useMD5) def writeKS(self, filename): + if self.auth.find("--enablemd5"): + useMD5 = True + else: + useMD5 = False + f = open(filename, "w") f.write("# Kickstart file automatically generated by anaconda.\n\n") @@ -167,17 +190,17 @@ class InstallData: self.xsetup.writeKS(f, self.desktop) self.network.writeKS(f) self.zfcp.writeKS(f) - self.rootPassword.writeKS(f, self.auth) + self.rootPassword.writeKS(f, useMD5) self.firewall.writeKS(f) + f.write("authconfig %s" % self.auth) self.security.writeKS(f) - self.auth.writeKS(f) self.timezone.writeKS(f) self.bootloader.writeKS(f) self.partitions.writeKS(f) #self.writePackagesKS(f) f.write("\n%post\n") - self.accounts.writeKScommands(f, self.auth) + self.accounts.writeKScommands(f, useMD5) # make it so only root can read, could have password os.chmod(filename, 0600) |