def _get_vmha_param(self, session, uuid, primary_id): # TODO(sampath): remove unused 'uuid' form args try: recover_data = dbapi.get_vm_list_by_id(session, primary_id) if recover_data is None: raise EnvironmentError("Failed to recovery info.") # Set return values. recover_by = recover_data.recover_by recover_to = recover_data.recover_to except EnvironmentError: self.rc_util.syslogout_ex("RecoveryControllerWorker_0007", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise EnvironmentError except KeyError: self.rc_util.syslogout_ex("RecoveryControllerWorker_0008", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise KeyError except: self.rc_util.syslogout_ex("RecoveryControllerWorker_0010", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise return recover_by, recover_to
def _get_vmha_param(self, session, uuid, primary_id): # TODO(sampath): remove unused 'uuid' form args try: recover_data = dbapi.get_vm_list_by_id(session, primary_id) if recover_data is None: raise EnvironmentError("Failed to recovery info.") # Set return values. recover_by = recover_data.recover_by recover_to = recover_data.recover_to except EnvironmentError: self.rc_util.syslogout_ex("RecoveryControllerWorker_0007", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise EnvironmentError except KeyError: self.rc_util.syslogout_ex("RecoveryControllerWorker_0008", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise KeyError except: self.rc_util.syslogout_ex("RecoveryControllerWorker_0010", syslog.LOG_ERR) error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) self.rc_util.syslogout(error_type, syslog.LOG_ERR) self.rc_util.syslogout(error_value, syslog.LOG_ERR) for tb in tb_list: self.rc_util.syslogout(tb, syslog.LOG_ERR) raise return recover_by, recover_to
def _get_vmha_param(self, session, uuid, primary_id): # TODO(sampath): remove unused 'uuid' form args try: msg = "Do get_vm_list_by_id." LOG.info(msg) recover_data = dbapi.get_vm_list_by_id(session, primary_id) msg = "Succeeded in get_vm_list_by_id. " \ + "Return_value = " + str(recover_data) LOG.info(msg) if recover_data is None: raise EnvironmentError("Failed to recovery info.") # Set return values. recover_by = recover_data.recover_by recover_to = recover_data.recover_to except EnvironmentError: error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) LOG.error(error_type) LOG.error(error_value) for tb in tb_list: LOG.error(tb) raise EnvironmentError except KeyError: error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) LOG.error(error_type) LOG.error(error_value) for tb in tb_list: LOG.error(tb) raise KeyError except: error_type, error_value, traceback_ = sys.exc_info() tb_list = traceback.format_tb(traceback_) LOG.error(error_type) LOG.error(error_value) for tb in tb_list: LOG.error(tb) raise return recover_by, recover_to