Example #1
0
    # Check that plugin paths are all absolute
    for path in startupconf.pluginpath:
        if not path[0] == '/':
            raise Errors.ConfigError(
                "All plugin search paths must be absolute")
    # Stuff this here to avoid later re-parsing
    startupconf._parser = parser

    # setup the release ver here
    if releasever is None:
        releasever = _getsysver(startupconf.installroot,
                                startupconf.distroverpkg)
    startupconf.releasever = releasever

    uuidfile = '%s/%s/uuid' % (startupconf.installroot, startupconf.persistdir)
    startupconf.uuid = get_uuid(uuidfile)

    return startupconf


def readMainConfig(startupconf):
    """Parse Yum's main configuration file

    :param startupconf: :class:`StartupConf` instance as returned by readStartupConfig()
    :return: Populated :class:`YumConf` instance
    """

    # ' xemacs syntax hack

    # Set up substitution vars
    yumvars = startupconf.yumvars
Example #2
0
    try:
        parser.readfp(confpp_obj)
    except ParsingError, e:
        raise Errors.ConfigError("Parsing file failed: %s" % e)
    startupconf.populate(parser, 'main')

    # Check that plugin paths are all absolute
    for path in startupconf.pluginpath:
        if not path[0] == '/':
            raise Errors.ConfigError("All plugin search paths must be absolute")
    # Stuff this here to avoid later re-parsing
    startupconf._parser = parser
    # setup the release ver here
    startupconf.releasever = _getsysver(startupconf.installroot, startupconf.distroverpkg)
    uuidfile = '%s/%s/uuid' % (startupconf.installroot, startupconf.persistdir)
    startupconf.uuid = get_uuid(uuidfile)

    return startupconf

def readMainConfig(startupconf):
    '''
    Parse Yum's main configuration file

    @param startupconf: StartupConf instance as returned by readStartupConfig()
    @return: Populated YumConf instance.
    '''
    
    # ' xemacs syntax hack

    # Set up substitution vars
    yumvars = _getEnvVar()