diff options
author | Chris Lumens <clumens@redhat.com> | 2009-12-21 11:33:00 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2010-02-04 15:06:49 -0500 |
commit | d057e82ad155654b511b513d239c843c7ebf7082 (patch) | |
tree | 3a1f327cb52afcc729e289c0d919375a13f2e8af /anaconda | |
parent | d6d4c4800ebc2958eb87a706e4a7c799647ca447 (diff) | |
download | anaconda-d057e82ad155654b511b513d239c843c7ebf7082.tar.gz anaconda-d057e82ad155654b511b513d239c843c7ebf7082.tar.xz anaconda-d057e82ad155654b511b513d239c843c7ebf7082.zip |
Move users and security to the Anaconda object.
This patch also moves rootPassword into Users where it belongs and auth
into Security where it belongs.
Diffstat (limited to 'anaconda')
-rwxr-xr-x | anaconda | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -386,11 +386,11 @@ def setupGraphicalLinks(): except: pass -def handleSshPw(ks): +def handleSshPw(anaconda): import users - u = users.Users() + u = users.Users(anaconda) - userdata = ks.sshpw.dataList() + userdata = anaconda.ksdata.sshpw.dataList() for ud in userdata: if u.checkUserExists(ud.username, root="/"): u.setUserPassword(username=ud.username, password=ud.password, @@ -462,11 +462,13 @@ class Anaconda(object): self.rescue_mount = True self.rootParts = None self.rootPath = "/mnt/sysimage" + self.security = security.Security() self.stage2 = None self.updateSrc = None self.upgrade = flags.cmdline.has_key("preupgrade") self.upgradeRoot = None self.upgradeSwapInfo = None + self._users = None # *sigh* we still need to be able to write this out self.xdriver = None @@ -545,6 +547,14 @@ class Anaconda(object): return self._platform + @property + def users(self): + if not self._users: + import users + self._users = users.Users(self) + + return self._users + def dumpState(self): from meh.dump import ReverseExceptionDump from inspect import stack as _stack @@ -627,6 +637,8 @@ class Anaconda(object): self.keyboard.write(self.rootPath) self.network.write(instPath=self.rootPath, anaconda=self) + self.users.write(self.rootPath) + self.security.write(self.rootPath) # XXX: This is temporary until instdata goes away completely. self.id.write() @@ -686,6 +698,9 @@ class Anaconda(object): self.keyboard.writeKS(f) self.network.writeKS(f) + self.users.writeKS(f) + self.security.writeKS(f) + # XXX: This is temporary until instdata goes away completely. self.id.writeKS(f) @@ -727,7 +742,7 @@ if __name__ == "__main__": import dispatch import warnings import vnc - import users + import users, security import kickstart import storage.storage_log import system_config_keyboard.keyboard as keyboard @@ -902,7 +917,7 @@ if __name__ == "__main__": # sshpw, but after that we start sshd, we need one that points to the # install target. luserConf = users.createLuserConf(instPath="") - handleSshPw(anaconda.ksdata) + handleSshPw(anaconda) startSsh() del(os.environ["LIBUSER_CONF"]) |