def parse_kickstart(ks, addon_paths, strict_mode=False): """Parse the given kickstart file. :param ks: a path to a kickstart file or None :param addon_paths: a dictionary of addon paths :param strict_mode: process warnings as errors if True :returns: kickstart parsed to a data model """ ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"]) if ks is not None: log.info("Parsing kickstart: %s", ks) kickstart.parseKickstart(ksdata, ks, strict_mode=strict_mode, pass_to_boss=True) return ksdata
def parse_kickstart(options, addon_paths, pass_to_boss=False): """Parse the input kickstart. If we were given a kickstart file, parse (but do not execute) that now. Otherwise, load in defaults from kickstart files shipped with the installation media. Pick up any changes from interactive-defaults.ks that would otherwise be covered by the dracut KS parser. :param options: command line/boot options :param dict addon_paths: addon paths dictionary :returns: kickstart parsed to a data model """ ksdata = None if options.ksfile and not options.liveinst: if not os.path.exists(options.ksfile): stdout_log.error("Kickstart file %s is missing.", options.ksfile) util.ipmi_report(constants.IPMI_ABORTED) sys.exit(1) flags.automatedInstall = True flags.eject = False ks_files = [options.ksfile] elif os.path.exists("/run/install/ks.cfg") and not options.liveinst: # this is to handle such cases where a user has pre-loaded a # ks.cfg onto an OEMDRV labeled device flags.automatedInstall = True flags.eject = False ks_files = ["/run/install/ks.cfg"] else: ks_files = [ "/tmp/updates/interactive-defaults.ks", "/usr/share/anaconda/interactive-defaults.ks" ] for ks in ks_files: if not os.path.exists(ks): continue kickstart.preScriptPass(ks) log.info("Parsing kickstart: " + ks) ksdata = kickstart.parseKickstart(ks, options.ksstrict) if pass_to_boss: distribute_kickstart_with_boss(ks) # Only load the first defaults file we find. break if not ksdata: ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"]) return ksdata
def parse_kickstart(options, addon_paths, pass_to_boss=False): """Parse the input kickstart. If we were given a kickstart file, parse (but do not execute) that now. Otherwise, load in defaults from kickstart files shipped with the installation media. Pick up any changes from interactive-defaults.ks that would otherwise be covered by the dracut KS parser. :param options: command line/boot options :param dict addon_paths: addon paths dictionary :returns: kickstart parsed to a data model """ ksdata = None if options.ksfile and not options.liveinst: if not os.path.exists(options.ksfile): stdout_log.error("Kickstart file %s is missing.", options.ksfile) util.ipmi_report(constants.IPMI_ABORTED) sys.exit(1) flags.automatedInstall = True flags.eject = False ks_files = [options.ksfile] elif os.path.exists("/run/install/ks.cfg") and not options.liveinst: # this is to handle such cases where a user has pre-loaded a # ks.cfg onto an OEMDRV labeled device flags.automatedInstall = True flags.eject = False ks_files = ["/run/install/ks.cfg"] else: ks_files = ["/tmp/updates/interactive-defaults.ks", "/usr/share/anaconda/interactive-defaults.ks"] for ks in ks_files: if not os.path.exists(ks): continue kickstart.preScriptPass(ks) log.info("Parsing kickstart: %s", ks) ksdata = kickstart.parseKickstart(ks, options.ksstrict, pass_to_boss) # Only load the first defaults file we find. break if not ksdata: ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"]) return ksdata
flags.automatedInstall = True flags.eject = False ksFiles = ["/run/install/ks.cfg"] else: ksFiles = [ "/tmp/updates/interactive-defaults.ks", "/usr/share/anaconda/interactive-defaults.ks" ] for ks in ksFiles: if not os.path.exists(ks): continue kickstart.preScriptPass(ks) log.info("Parsing kickstart: " + ks) ksdata = kickstart.parseKickstart(ks) # Only load the first defaults file we find. break if not ksdata: ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"]) # Pick up any changes from interactive-defaults.ks that would # otherwise be covered by the dracut KS parser. if ksdata.bootloader.extlinux: flags.extlinux = True if ksdata.rescue.rescue: flags.rescue_mode = True # reboot with kexec
# this is to handle such cases where a user has pre-loaded a # ks.cfg onto an OEMDRV labeled device flags.automatedInstall = True flags.eject = False ksFiles = ["/run/install/ks.cfg"] else: ksFiles = ["/tmp/updates/interactive-defaults.ks", "/usr/share/anaconda/interactive-defaults.ks"] for ks in ksFiles: if not os.path.exists(ks): continue kickstart.preScriptPass(ks) log.info("Parsing kickstart: " + ks) ksdata = kickstart.parseKickstart(ks) # Only load the first defaults file we find. break if not ksdata: ksdata = kickstart.AnacondaKSHandler(addon_paths["ks"]) # Pick up any changes from interactive-defaults.ks that would # otherwise be covered by the dracut KS parser. if ksdata.bootloader.extlinux: flags.extlinux = True if ksdata.rescue.rescue: flags.rescue_mode = True # reboot with kexec