示例#1
0
def start_geolocation(provider_id=constants.GEOLOC_DEFAULT_PROVIDER):
    """Start an asynchronous geolocation attempt.

    The data from geolocation is used to pre-select installation language and timezone.

    :param str provider_id: geolocation provider id
    """
    # check if the provider id is valid
    parsed_id = geoloc.get_provider_id_from_option(provider_id)
    if parsed_id is None:
        log.error('geoloc: wrong provider id specified: %s', provider_id)
    else:
        provider_id = parsed_id
    # instantiate the geolocation module and start location data refresh
    geoloc.init_geolocation(provider_id=provider_id)
    geoloc.refresh()
示例#2
0
def start_geolocation(provider_id=constants.GEOLOC_DEFAULT_PROVIDER):
    """Start an asynchronous geolocation attempt.

    The data from geolocation is used to pre-select installation language and timezone.

    :param str provider_id: geolocation provider id
    """
    # check if the provider id is valid
    parsed_id = geoloc.get_provider_id_from_option(provider_id)
    if parsed_id is None:
        log.error('geoloc: wrong provider id specified: %s', provider_id)
    else:
        provider_id = parsed_id
    # instantiate the geolocation module and start location data refresh
    geoloc.init_geolocation(provider_id=provider_id)
    geoloc.refresh()
示例#3
0
    # check if geolocation should be enabled for this type of installation
    use_geolocation = True
    if flags.imageInstall or flags.dirInstall or flags.automatedInstall:
        use_geolocation = False
    # and also check if it was not disabled by boot option
    else:
        # flags.cmdline.getbool is used as it handles values such as
        # 0, no, off and also nogeoloc as False
        # and other values or geoloc not being present as True
        use_geolocation = flags.cmdline.getbool('geoloc', True)

    if use_geolocation:
        provider_id = constants.GEOLOC_DEFAULT_PROVIDER
        # check if a provider was specified by an option
        if opts.geoloc is not None:
            parsed_id = geoloc.get_provider_id_from_option(opts.geoloc)
            if parsed_id is None:
                log.error('geoloc: wrong provider id specified: %s',
                          opts.geoloc)
            else:
                provider_id = parsed_id
        # instantiate the geolocation module and start location data refresh
        geoloc.init_geolocation(provider_id=provider_id)
        geoloc.refresh()

    # setup ntp servers and start NTP daemon if not requested otherwise
    if can_touch_runtime_system("start chronyd"):
        if anaconda.ksdata.timezone.ntpservers:
            pools, servers = ntp.internal_to_pools_and_servers(
                anaconda.ksdata.timezone.ntpservers)
            ntp.save_servers_to_config(pools, servers)
示例#4
0
    # check if geolocation should be enabled for this type of installation
    use_geolocation = True
    if flags.imageInstall or flags.dirInstall or flags.automatedInstall:
        use_geolocation = False
    # and also check if it was not disabled by boot option
    else:
        # flags.cmdline.getbool is used as it handles values such as
        # 0, no, off and also nogeoloc as False
        # and other values or geoloc not being present as True
        use_geolocation = flags.cmdline.getbool('geoloc', True)

    if use_geolocation:
        provider_id = constants.GEOLOC_DEFAULT_PROVIDER
        # check if a provider was specified by an option
        if opts.geoloc is not None:
            parsed_id = geoloc.get_provider_id_from_option(opts.geoloc)
            if parsed_id is None:
                log.error('geoloc: wrong provider id specified: %s', opts.geoloc)
            else:
                provider_id = parsed_id
        # instantiate the geolocation module and start location data refresh
        geoloc.init_geolocation(provider_id=provider_id)
        geoloc.refresh()

    # setup ntp servers and start NTP daemon if not requested otherwise
    if can_touch_runtime_system("start chronyd"):
        if anaconda.ksdata.timezone.ntpservers:
            pools, servers = ntp.internal_to_pools_and_servers(anaconda.ksdata.timezone.ntpservers)
            ntp.save_servers_to_config(pools, servers)

        if not anaconda.ksdata.timezone.nontp: