Exemple #1
0
 def OnGMMsg(self, gm_cmd, params_str):
     logger.GetLog().debug('fight proxy on gm msg , gm_cmd : %s, params_str: %s' % (gm_cmd, params_str))
     if gm_cmd == gm_def.gm_cmd_reload_script:
         fail_file_list = utils.execute_reload_files_command(params_str)
         if fail_file_list:  # 有失败的文件
             self.get_fight_proxy_to_monitor_rpc().OnGMMsgResponse('fight proxy executed gm command %s fail, fail files : %s' % (gm_cmd, fail_file_list))
         else:   # 所有文件重load成功
             self.get_fight_proxy_to_monitor_rpc().OnGMMsgResponse('fight proxy executed gm command %s success' % gm_cmd)
     else:
         # 参数不对或者不支持的
         return_msg = 'fight proxy unsupported gm command or param unexpected : %s' % gm_cmd
         logger.GetLog().warn(return_msg)
         self.get_fight_proxy_to_monitor_rpc().OnGMMsgResponse(return_msg)
Exemple #2
0
 def OnGMMsg(self, gm_cmd, params_str):
     if gm_cmd == gm_def.gm_cmd_reload_script:
         fail_file_list = utils.execute_reload_files_command(params_str)
         if fail_file_list:  # 有失败的文件
             self.OnGMMsgHandleResponse(
                 'monitor executed gm command %s fail, fail files : %s' %
                 (gm_cmd, fail_file_list))
         else:  # 所有文件重load成功
             self.OnGMMsgHandleResponse(
                 'monitor executed gm command %s success' % gm_cmd)
     else:
         return_msg = 'monitor unsupported gm command or param unexpected : %s, %s' % (
             gm_cmd, params_str)
         logger.GetLog().warn(return_msg)
         self.OnGMMsgHandleResponse(return_msg)
Exemple #3
0
 def OnGMMsg(self, gm_cmd, params_str):
     logger.GetLog().debug('gateway on gm msg content = %s, %s' %
                           (gm_cmd, params_str))
     if gm_cmd == gm_def.gm_cmd_reload_script:
         fail_file_list = utils.execute_reload_files_command(params_str)
         if fail_file_list:  # 有失败的文件
             self.get_gateway_2_monitor_rpc().OnGMMsgResponse(
                 'gateway %s executed gm command %s fail, fail files : %s' %
                 (self.get_node_id(), gm_cmd, fail_file_list))
         else:  # 所有文件重load成功
             self.get_gateway_2_monitor_rpc().OnGMMsgResponse(
                 'gateway executed gm command %s success' % gm_cmd)
     else:
         return_msg = 'gateway unsupported gm command or param unexpected : %s, %s' % (
             gm_cmd, params_str)
         logger.GetLog().warn(return_msg)
         self.get_gateway_2_monitor_rpc().OnGMMsgResponse(return_msg)
Exemple #4
0
 def OnGMMsg(self, gm_cmd, params_str):
     logger.GetLog().debug('db proxy on gm msg content = %s, %s' %
                           (gm_cmd, params_str))
     if gm_cmd == gm_def.gm_cmd_reload_script:
         fail_file_list = utils.execute_reload_files_command(params_str)
         if fail_file_list:  # 有失败的文件
             self.get_db_2_monitor_rpc().OnGMMsgResponse(
                 'db proxy %s executed gm command %s fail, fail files : %s'
                 % (self.get_node_id(), gm_cmd, fail_file_list))
         else:  # 所有文件重load成功
             self.get_db_2_monitor_rpc().OnGMMsgResponse(
                 'db proxy %s executed gm command %s success' %
                 (self.get_node_id(), gm_cmd))
     elif gm_cmd == gm_def.gm_cmd_update_data:
         reload_master_list = [
             x.strip() for x in params_str.split(',') if x
         ]
         logger.GetLog().debug('db reload master : %s' % reload_master_list)
         fail_file_list = []
         for master_inst_name in reload_master_list:
             try:
                 masters_global.reload_data_inst(master_inst_name)
             except Exception as e:
                 fail_file_list.append(master_inst_name)
         if fail_file_list:  # 有失败的文件
             self.get_db_2_monitor_rpc().OnGMMsgResponse(
                 'db proxy %s executed gm command %s fail, fail files : %s'
                 % (self.get_node_id(), gm_cmd, fail_file_list))
         else:  # 所有文件重load成功
             self.get_db_2_monitor_rpc().OnGMMsgResponse(
                 'db proxy %s executed gm command %s success' %
                 (self.get_node_id(), gm_cmd))
     else:
         return_msg = 'db proxy unsupported gm command or param unexpected : %s, %s' % (
             gm_cmd, params_str)
         logger.GetLog().warn(return_msg)
         self.get_db_2_monitor_rpc().OnGMMsgResponse(return_msg)