def postAction(self, anaconda, serial): postScripts = filter(lambda s: s.type == KS_SCRIPT_POST, self.ksdata.scripts) if len(postScripts) == 0: return # Remove environment variables that cause problems for %post scripts. for var in ["LIBUSER_CONF"]: if os.environ.has_key(var): del (os.environ[var]) # ROCKS # need to reread the disk set before we execute the post sections. # this is because of software raid. in the patch above, we read # the disk set *before* the software raid device is created, thus, # there will be no software raid device in the disk set. the first # post section reports the partitions back to the frontend's database, # so before we run that code, we need to make sure all software # raid devices are discovered. # from partedUtils import DiskSet ds = DiskSet(self.anaconda) diskfile = open('/tmp/discovered.disks', 'w') disks = ds.driveList() ds.startMdRaid() diskfile.write('disks: %s\n' % (' '.join(disks))) swraid = [] for dev, devices, level, numActive in ds.mdList: if dev not in swraid: swraid.append(dev) diskfile.write('raids: %s\n' % (' '.join(swraid))) diskfile.close() # ROCKS log.info("Running kickstart %%post script(s)") if anaconda.intf is not None: w = anaconda.intf.waitWindow(_("Running..."), _("Running post-install scripts")) map(lambda s: s.run(anaconda.rootPath, serial, anaconda.intf), postScripts) log.info("All kickstart %%post script(s) have been run") if anaconda.intf is not None: w.pop()
def postAction(self, anaconda, serial): postScripts = filter(lambda s: s.type == KS_SCRIPT_POST, self.ksdata.scripts) if len(postScripts) == 0: return # Remove environment variables that cause problems for %post scripts. for var in ["LIBUSER_CONF"]: if os.environ.has_key(var): del (os.environ[var]) # ROCKS # need to reread the disk set before we execute the post sections. # this is because of software raid. in the patch above, we read # the disk set *before* the software raid device is created, thus, # there will be no software raid device in the disk set. the first # post section reports the partitions back to the frontend's database, # so before we run that code, we need to make sure all software # raid devices are discovered. # from partedUtils import DiskSet ds = DiskSet(self.anaconda) diskfile = open("/tmp/discovered.disks", "w") disks = ds.driveList() ds.startMdRaid() diskfile.write("disks: %s\n" % (" ".join(disks))) swraid = [] for dev, devices, level, numActive in ds.mdList: if dev not in swraid: swraid.append(dev) diskfile.write("raids: %s\n" % (" ".join(swraid))) diskfile.close() # ROCKS log.info("Running kickstart %%post script(s)") if anaconda.intf is not None: w = anaconda.intf.waitWindow(_("Running..."), _("Running post-install scripts")) map(lambda s: s.run(anaconda.rootPath, serial, anaconda.intf), postScripts) log.info("All kickstart %%post script(s) have been run") if anaconda.intf is not None: w.pop()