def setup_logging_from_options(options): """Configure logging according to Anaconda command line/boot options. :param options: Anaconda command line/boot options """ if (options.debug or options.updateSrc) and not options.loglevel: # debugging means debug logging if an explicit level hasn't been st options.loglevel = "debug" if options.loglevel and options.loglevel in anaconda_logging.logLevelMap: log.info("Switching logging level to %s", options.loglevel) level = anaconda_logging.logLevelMap[options.loglevel] anaconda_logging.logger.loglevel = level anaconda_logging.setHandlersLevel(log, level) storage_log = get_storage_logger() anaconda_logging.setHandlersLevel(storage_log, level) packaging_log = get_packaging_logger() anaconda_logging.setHandlersLevel(packaging_log, level) if conf.system.can_modify_syslog: if options.syslog: anaconda_logging.logger.updateRemote(options.syslog) if options.remotelog: try: host, port = options.remotelog.split(":", 1) port = int(port) anaconda_logging.logger.setup_remotelog(host, port) except ValueError: log.error("Could not setup remotelog with %s", options.remotelog)
def setup_logging_from_options(options): """Configure logging according to Anaconda command line/boot options. :param options: Anaconda command line/boot options """ if (options.debug or options.updateSrc) and not options.loglevel: # debugging means debug logging if an explicit level hasn't been st options.loglevel = "debug" if options.loglevel and options.loglevel in anaconda_logging.logLevelMap: log.info("Switching logging level to %s", options.loglevel) level = anaconda_logging.logLevelMap[options.loglevel] anaconda_logging.logger.loglevel = level anaconda_logging.setHandlersLevel(log, level) storage_log = get_storage_logger() anaconda_logging.setHandlersLevel(storage_log, level) packaging_log = get_packaging_logger() anaconda_logging.setHandlersLevel(packaging_log, level) if can_touch_runtime_system("syslog setup"): if options.syslog: anaconda_logging.logger.updateRemote(options.syslog) if options.remotelog: try: host, port = options.remotelog.split(":", 1) port = int(port) anaconda_logging.logger.setup_remotelog(host, port) except ValueError: log.error("Could not setup remotelog with %s", options.remotelog)
import pyanaconda.payload as payload import configparser import collections import itertools import multiprocessing import operator import hashlib import shutil import sys import time import threading from requests.exceptions import RequestException from pyanaconda.anaconda_loggers import get_packaging_logger, get_dnf_logger log = get_packaging_logger() import dnf import dnf.logging import dnf.exceptions import dnf.repo import dnf.callback import dnf.conf.parser import dnf.conf.substitutions import rpm import librepo DNF_CACHE_DIR = '/tmp/dnf.cache' DNF_PLUGINCONF_DIR = '/tmp/dnf.pluginconf' DNF_PACKAGE_CACHE_DIR_SUFFIX = 'dnf.package.cache' DNF_LIBREPO_LOG = '/tmp/dnf.librepo.log'
from pyanaconda.core import util from pyanaconda.core.i18n import _ from pyanaconda.payload import Payload from pyanaconda.payload import payload_utils from pyanaconda.payload.errors import PayloadSetupError, PayloadInstallError from pyanaconda.threading import threadMgr, AnacondaThread from pyanaconda.errors import errorHandler, ERROR_RAISE from pyanaconda.progress import progressQ from pyanaconda.core.constants import INSTALL_TREE, THREAD_LIVE_PROGRESS from pyanaconda.core.constants import IMAGE_DIR, TAR_SUFFIX from blivet.size import Size from pyanaconda.anaconda_loggers import get_packaging_logger log = get_packaging_logger() class LiveImagePayload(Payload): """ A LivePayload copies the source image onto the target system. """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # Used to adjust size of sysroot when files are already present self._adj_size = 0 self.pct = 0 self.pct_lock = None self.source_size = 1 self._kernel_version_list = [] def setup(self, storage):