def __init__(self, parent, section=None, parser=None): super(RepoConf, self).__init__(cfg.ConfigRepo( parent._config if parent else cfg.ConfigMain()), section, parser) self._masterConfig = parent._config if parent else cfg.ConfigMain() # modularity # TODO move to libdnf self.hotfixes = BoolOption(False)
def __init__(self, section='main', parser=None): # pylint: disable=R0915 config = cfg.ConfigMain() super(MainConf, self).__init__(config, section, parser) self._get_option('pluginpath')._set([dnf.const.PLUGINPATH], PRIO_DEFAULT) self._get_option('pluginconfpath')._set([dnf.const.PLUGINCONFPATH], PRIO_DEFAULT) self.substitutions = dnf.conf.substitutions.Substitutions() self.arch = hawkey.detect_arch() self._config.system_cachedir().set(PRIO_DEFAULT, dnf.const.SYSTEM_CACHEDIR) # setup different cache and log for non-priviledged users if dnf.util.am_i_root(): cachedir = dnf.const.SYSTEM_CACHEDIR logdir = '/var/log' else: try: cachedir = logdir = misc.getCacheDir() except (IOError, OSError) as e: msg = _('Could not set cachedir: {}').format(ucd(e)) raise dnf.exceptions.Error(msg) self._config.cachedir().set(PRIO_DEFAULT, cachedir) self._config.logdir().set(PRIO_DEFAULT, logdir) # TODO move to libdnf self.modulesdir = PathOption('/etc/dnf/modules.d', absPath=True) # TODO move to libdnf self.moduledefaultsdir = PathOption('/etc/dnf/modules.defaults.d', absPath=True)
def __init__(self, parent, section=None, parser=None): super(RepoConf, self).__init__(cfg.ConfigRepo( parent._config if parent else cfg.ConfigMain()), section, parser) self._masterConfig = parent._config if parent else cfg.ConfigMain()