def apply(self): """ Execute the selections made. """ # if we had any errors, e.g. from a previous attempt to set the source, # clear them at this point self._error = False payloadMgr.restart_thread(self.payload, checkmount=False)
def apply(self): """ Execute the selections made. """ # if we had any errors, e.g. from a previous attempt to set the source, # clear them at this point self._error = False payloadMgr.restart_thread(self.storage, self.data, self.payload, checkmount=False)
def unset_source(self): """Unset an already selected source method. Unset the source in kickstart and notify the payload so that it can correctly release all related resources (unmount iso files, drop caches, etc.). """ self._clean_hdd_iso() self.data.method.method = None payloadMgr.restart_thread(self.payload, checkmount=False) # pylint: disable=no-member threadMgr.wait(constants.THREAD_PAYLOAD_RESTART) threadMgr.wait(constants.THREAD_PAYLOAD)
def unset_source(self): """Unset an already selected source method. Unset the source in kickstart and notify the payload so that it can correctly release all related resources (unmount iso files, drop caches, etc.). """ self._clean_hdd_iso() self.data.method.method = None payloadMgr.restart_thread(self.storage, self.data, self.payload, checkmount=False) # pylint: disable=no-member threadMgr.wait(constants.THREAD_PAYLOAD_RESTART) threadMgr.wait(constants.THREAD_PAYLOAD)
def _do_payload_restart(payload): """Restart the Anaconda payload. This should be done after changing the installation sorce, such as when switching to and from the CDN. :param payload: Anaconda payload instance """ # restart payload payloadMgr.restart_thread(payload, fallback=False, checkmount=False, onlyOnChange=False)
def apply(self): """ Execute the selections made. """ # If askmethod was provided on the command line, entering the source # spoke wipes that out. if flags.askmethod: flags.askmethod = False # if we had any errors, e.g. from a previous attempt to set the source, # clear them at this point self._error = False payloadMgr.restart_thread(self.storage, self.data, self.payload, checkmount=False)
def _subscription_progress_callback(self, phase): """Progress handling for subscription thread. Used both for both registration + attaching subscription and for unregistration. NOTE: Using the @async_action_wait decorator as this is called from the subscription thread. We need to do that as GTK does bad things if non main threads interact with it. """ # clear error message from a previous attempt (if any) self.registration_error = "" # set registration phase self.registration_phase = phase # set spoke status according to subscription thread phase if phase == SubscriptionPhase.DONE: log.debug("Subscription GUI: registration & attach done") # we are done, clear the phase self.registration_phase = None # restart the payload so that it picks up # the new repo file generated by RHSM either # showing up (registration+subscription) # or vanishing (unregistration) payloadMgr.restart_thread(self.payload, fallback=False, checkmount=False, onlyOnChange=False) # update registration and subscription parts of the spoke self._update_registration_state() self._update_subscription_state() # enable controls self.set_registration_controls_sensitive(True) # notify hub hubQ.send_ready(self.__class__.__name__, False) else: # processing still ongoing, set the phase self.registration_phase = phase # notify hub hubQ.send_ready(self.__class__.__name__, False) # update spoke state self._update_registration_state()
def apply(self): """Apply all of our settings.""" # Inform network module that device configurations might have been changed # and we want to generate kickstart from device configurations # (persistent NM / config files configuration), instead of using original kickstart. self._network_module.NetworkDeviceConfigurationChanged() (valid, error) = network.is_valid_hostname(self.hostname, local=True) if not self.hostname or valid: self._network_module.SetHostname(self.hostname) else: self.errors.append(_("Host name is not valid: %s") % error) self.hostname = self._network_module.Hostname if self._apply: self._apply = False if ANACONDA_ENVIRON in flags.environs: from pyanaconda.payload.manager import payloadMgr payloadMgr.restart_thread(self.payload, checkmount=False)
def apply(self): """Apply all of our settings.""" # Inform network module that device configurations might have been changed # and we want to generate kickstart from device configurations # (persistent NM / ifcfg configuration), instead of using original kickstart. self._network_module.proxy.NetworkDeviceConfigurationChanged() (valid, error) = network.is_valid_hostname(self.hostname) if valid: self._network_module.proxy.SetHostname(self.hostname) else: self.errors.append(_("Host name is not valid: %s") % error) self.hostname = self._network_module.proxy.Hostname if self._apply: self._apply = False if ANACONDA_ENVIRON in flags.environs: from pyanaconda.payload.manager import payloadMgr payloadMgr.restart_thread(self.storage, self.data, self.payload, checkmount=False)
def _subscription_error_callback(self, error_message): log.debug("Subscription GUI: registration & attach failed") # store the error message self.registration_error = error_message # even if we fail, we are technically done, # so clear the phase self.registration_phase = None # restart payload payloadMgr.restart_thread(self.payload, fallback=False, checkmount=False, onlyOnChange=False) # update registration and subscription parts of the spoke self._update_registration_state() self._update_subscription_state() # re-enable controls, so user can try again self.set_registration_controls_sensitive(True) # notify hub hubQ.send_ready(self.__class__.__name__, False)
# 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) # 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:
threadMgr.add( AnacondaThread( name=constants.THREAD_SUBSCRIPTION, target=register_and_subscribe, args=[anaconda.payload] ) ) # 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 \ or anaconda.payload.source_type == conf.payload.default_source payloadMgr.restart_thread(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 startup_utils.start_chronyd() # Finish the initialization of the setup on boot action. # This should be done sooner and somewhere else once it is possible. from pyanaconda.core.constants import SETUP_ON_BOOT_DEFAULT, SETUP_ON_BOOT_ENABLED from pyanaconda.modules.common.constants.services import SERVICES
# 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) # 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)