from pyanaconda.core.configuration.anaconda import conf conf.set_from_opts(opts) # Set up logging as early as possible. from pyanaconda import anaconda_logging from pyanaconda import anaconda_loggers anaconda_logging.init(write_to_journal=conf.target.is_hardware) anaconda_logging.logger.setupVirtio(opts.virtiolog) # Load the remaining configuration after a logging is set up. conf.set_from_product(opts.product_name, opts.variant_name) conf.set_from_files() conf.set_from_opts(opts) log = anaconda_loggers.get_main_logger() stdout_log = anaconda_loggers.get_stdout_logger() if os.geteuid() != 0: stdout_log.error("anaconda must be run as root.") sys.exit(1) # check if input kickstart should be saved if flags.nosave_input_ks: log.warning( "Input kickstart will not be saved to the installed system due to the nosave option." ) util.touch('/tmp/NOSAVE_INPUT_KS') # check if logs should be saved if flags.nosave_logs:
from pyanaconda.flags import flags (opts, depr) = parse_arguments(boot_cmdline=flags.cmdline) from pyanaconda.core.configuration.anaconda import conf conf.set_from_opts(opts) # Set up logging as early as possible. from pyanaconda import anaconda_logging from pyanaconda import anaconda_loggers anaconda_logging.init(write_to_journal=conf.target.is_hardware) anaconda_logging.logger.setupVirtio(opts.virtiolog) from pyanaconda import network network.setup_ifcfg_log() log = anaconda_loggers.get_main_logger() stdout_log = anaconda_loggers.get_stdout_logger() if os.geteuid() != 0: stdout_log.error("anaconda must be run as root.") sys.exit(1) # check if input kickstart should be saved if flags.nosave_input_ks: log.warning("Input kickstart will not be saved to the installed system due to the nosave option.") util.touch('/tmp/NOSAVE_INPUT_KS') # check if logs should be saved if flags.nosave_logs: log.warning("Installation logs will not be saved to the installed system due to the nosave option.") util.touch('/tmp/NOSAVE_LOGS')