Ejemplo n.º 1
0
 def __setstate__(self, state):
     try:
         self.logger.log(1, "restart: initializing base system class")
         BGBaseSystem.__setstate__(self, state)
         self.process_groups.item_cls = BGSimProcessGroup
         self.node_card_cache = dict()
         try:
             self.failed_components = state['failed_components']
         except KeyError:
             self.failed_components = set()
         try:
             self.config_file = state['config_file']
         except KeyError:
             self.config_file = os.path.expandvars(get_config_option('system', 'def_file', ""))
         if self.config_file:
             self.logger.log(1, "restart: loading machine configuration")
             self.configure(self.config_file)
             self.logger.log(1, "restart: restoring partition state")
             self._restore_partition_state(state)
             self.logger.log(1, "restart: recomputing partition state")
             self._recompute_partition_state()
     except:
         self.logger.error("A fatal error occurred while restarting the system component", exc_info=True)
         print "A fatal error occurred while restarting the system component.  Terminating."
         sys.exit(1)
Ejemplo n.º 2
0
 def __setstate__(self, state):
     try:
         self.logger.log(1, "restart: initializing base system class")
         BGBaseSystem.__setstate__(self, state)
         self.process_groups.item_cls = BGSimProcessGroup
         self.node_card_cache = dict()
         try:
             self.failed_components = state['failed_components']
         except KeyError:
             self.failed_components = set()
         try:
             self.config_file = state['config_file']
         except KeyError:
             self.config_file = os.path.expandvars(
                 get_config_option('system', 'def_file', ""))
         if self.config_file:
             self.logger.log(1, "restart: loading machine configuration")
             self.configure(self.config_file)
             self.logger.log(1, "restart: restoring partition state")
             self._restore_partition_state(state)
             self.logger.log(1, "restart: recomputing partition state")
             self._recompute_partition_state()
     except:
         self.logger.error(
             "A fatal error occurred while restarting the system component",
             exc_info=True)
         print "A fatal error occurred while restarting the system component.  Terminating."
         sys.exit(1)
Ejemplo n.º 3
0
 def __setstate__(self, state):
     BGBaseSystem.__setstate__(self, state)
     self.config_file = state['config_file']
     self.process_groups.item_cls = BGSimProcessGroup
     if self.config_file is not None:
         self.configure(self.config_file)
     self.update_relatives()
     self._restore_partition_state(state)
Ejemplo n.º 4
0
 def __setstate__(self, state):
     BGBaseSystem.__setstate__(self, state)
     self.config_file = state['config_file']
     self.process_groups.item_cls = BGSimProcessGroup
     if self.config_file is not None:
         self.configure(self.config_file)
     self.update_relatives()
     self._restore_partition_state(state)
Ejemplo n.º 5
0
    def __setstate__(self, state):
        BGBaseSystem.__setstate__(self, state)
        self.process_groups.item_cls = BGProcessGroup
        self.configure()
        self.update_relatives()
        self._restore_partition_state(state)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
Ejemplo n.º 6
0
    def __setstate__(self, state):
        BGBaseSystem.__setstate__(self, state)
        self.process_groups.item_cls = BGProcessGroup
        self.configure()
        self.update_relatives()
        self._restore_partition_state(state)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())
Ejemplo n.º 7
0
    def __setstate__(self, state):
        try:
            BGBaseSystem.__setstate__(self, state)
            self.process_groups.item_cls = BGProcessGroup
            self.bp_cache = dict()
            self.node_card_cache = dict()
            self.wire_cache = dict()
            self.busted_switches = set()
            self.busted_wires = set()
            self.logger.debug("restart: loading machine configuration")
            self.configure()
            self.logger.debug("restart: restoring partition state")
            self._restore_partition_state(state)
            self.logger.debug("restart: recomputing partition state")
            self._recompute_partition_state()
        except:
            self.logger.error("A fatal error occurred while restarting the system component", exc_info=True)
            print "A fatal error occurred while restarting the system component.  Terminating."
            sys.exit(1)

        # initiate the process before starting any threads
        thread.start_new_thread(self.update_partition_state, tuple())