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()
from pyanaconda import exception anaconda.mehConfig = exception.initExceptionHandling(anaconda) # add additional repositories from the cmdline to kickstart data anaconda.add_additional_repositories_to_ksdata() # Fallback to default for interactive or for a kickstart with no installation method. fallback = not (flags.automatedInstall and ksdata.method.method) payloadMgr.restart_thread(anaconda.storage, ksdata, anaconda.payload, fallback=fallback) # initialize the geolocation singleton geoloc.init_geolocation(geoloc_option=opts.geoloc, options_override=opts.geoloc_use_with_ks) # start geolocation lookup if enabled if geoloc.geoloc.enabled: geoloc.geoloc.refresh() # setup ntp servers and start NTP daemon if not requested otherwise if conf.system.can_set_time_synchronization: kickstart_ntpservers = timezone_proxy.NTPServers if kickstart_ntpservers: pools, servers = ntp.internal_to_pools_and_servers( kickstart_ntpservers) ntp.save_servers_to_config(pools, servers) if timezone_proxy.NTPEnabled:
# add our own additional signal handlers signal.signal(signal.SIGUSR1, lambda signum, frame: exception.test_exception_handling()) signal.signal(signal.SIGUSR2, lambda signum, frame: anaconda.dumpState()) atexit.register(exitHandler, ksdata.reboot, anaconda.storage) from pyanaconda import exception anaconda.mehConfig = exception.initExceptionHandling(anaconda) # Fallback to default for interactive or for a kickstart with no installation method. fallback = not (flags.automatedInstall and ksdata.method.method) payloadMgr.restartThread(anaconda.storage, ksdata, anaconda.payload, anaconda.instClass, fallback=fallback) # initialize the geolocation singleton geoloc.init_geolocation(geoloc_option=opts.geoloc, options_override=opts.geoloc_use_with_ks, install_class_override=anaconda.instClass.use_geolocation_with_kickstart) # start geolocation lookup if enabled if geoloc.geoloc.enabled: geoloc.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")
# 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)
# 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: 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()
exception.test_exception_handling()) signal.signal(signal.SIGUSR2, lambda signum, frame: anaconda.dumpState()) atexit.register(exitHandler, ksdata.reboot, anaconda.storage) from pyanaconda import exception anaconda.mehConfig = exception.initExceptionHandling(anaconda) # add additional repositories from the cmdline to kickstart data anaconda.add_additional_repositories_to_ksdata() # Fallback to default for interactive or for a kickstart with no installation method. fallback = not (flags.automatedInstall and ksdata.method.method) payloadMgr.restartThread(anaconda.storage, ksdata, anaconda.payload, anaconda.instClass, fallback=fallback) # initialize the geolocation singleton geoloc.init_geolocation(geoloc_option=opts.geoloc, options_override=opts.geoloc_use_with_ks) # start geolocation lookup if enabled if geoloc.geoloc.enabled: geoloc.geoloc.refresh() # setup ntp servers and start NTP daemon if not requested otherwise if conf.system.can_set_time_synchronization: kickstart_ntpservers = timezone_proxy.NTPServers if kickstart_ntpservers: pools, servers = ntp.internal_to_pools_and_servers(kickstart_ntpservers) ntp.save_servers_to_config(pools, servers) if timezone_proxy.NTPEnabled: util.start_service("chronyd")