Beispiel #1
0
 def handleExit(self):
   """ Function executed when the Python system exits. This unregisters the machine in etcd. """
   self.is_running = False
   try:
     machine_state = MachineState(self.project_name, self.machine_id, self.etcd_client)
     machine_state.removeMachine()
   except Exception as e:
     self.logger.exception(e)
     pass
Beispiel #2
0
 def reportMachineStatus(self):
   """ Reports that this machine has running components. """
   while self.is_running:
     # Perform the update.
     self.logger.debug('Reporting status for machine %s to etcd', self.machine_id)
     machine_state = MachineState(self.project_name, self.machine_id, self.etcd_client)
     machine_state.registerMachine([c.getName() for c in self.components], ttl = REPORT_TTL)
     
     # Sleep for the TTL minus a few seconds.
     time.sleep(REPORT_TTL - 5)
Beispiel #3
0
    def reportMachineStatus(self):
        """ Reports that this machine has running components. """
        while self.is_running:
            # Perform the update.
            self.logger.debug('Reporting status for machine %s to etcd',
                              self.machine_id)
            machine_state = MachineState(self.project_name, self.machine_id,
                                         self.etcd_client)
            machine_state.registerMachine(
                [c.getName() for c in self.components], ttl=REPORT_TTL)

            # Sleep for the TTL minus a few seconds.
            time.sleep(REPORT_TTL - 5)
Beispiel #4
0
  def handleExit(self):
    """ Function executed when the Python system exits. This unregisters the machine in etcd. """
    self.is_running = False
    try:
      machine_state = MachineState(self.project_name, self.machine_id, self.etcd_client)
      machine_state.removeMachine()

      # Shut down the runtime manager if we have one
      if self.runtime_manager is not None:
        self.runtime_manager.join()

    except Exception as e:
      self.logger.exception(e)
      pass
Beispiel #5
0
    def handleExit(self):
        """ Function executed when the Python system exits. This unregisters the machine in etcd. """
        self.is_running = False
        try:
            machine_state = MachineState(self.project_name, self.machine_id,
                                         self.etcd_client)
            machine_state.removeMachine()

            # Shut down the runtime manager if we have one
            if self.runtime_manager is not None:
                self.runtime_manager.join()

        except Exception as e:
            self.logger.exception(e)
            pass