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()
# 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: iutil.start_service("chronyd") # FIXME: This will need to be made cleaner once this file starts to take # shape with the new UI code. anaconda._intf.setup(ksdata) anaconda._intf.run()
# 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: iutil.start_service("chronyd") # FIXME: This will need to be made cleaner once this file starts to take # shape with the new UI code. anaconda._intf.setup(ksdata) anaconda._intf.run()