def __start_hw_thread(self, file_name): """ Creates the thread object that checks the HW. Picks up from it the object that represents the HW hierarchy. Starts the thread (this could also be done in the thread's constructor. """ try: self.__hw_mon = HardwareMonitoring(self, file_name) self.__hw_tree_struct = self.__hw_mon.get_hw_tree() self.__logger.info('Starting HW monitoring thread...') except Exception as e: self.__logger.critical( 'Exception while instantiating HW monitoring thread! %s Exiting...', str(e)) import sys sys.exit(1) try: self.__hw_mon.start() except RuntimeError as e: self.__logger.critical( 'Tried to initiate twice the HW monitoring thread! Message %s Exiting...', str(e)) self.__hw_mon.set_thread_running(False) self.__hw_mon.join() import sys sys.exit(1)
def __start_hw_thread(self, file_name): """ Creates the thread object that checks the HW. Picks up from it the object that represents the HW hierarchy. Starts the thread (this could also be done in the thread's constructor. """ try: self.__hw_mon = HardwareMonitoring(self, file_name) self.__hw_tree_struct = self.__hw_mon.get_hw_tree() self.__logger.info('Starting HW monitoring thread...') except Exception, e: self.__logger.critical( 'Exception while instantiating HW monitoring thread! %s Exiting...', str(e)) import sys sys.exit(1)