예제 #1
0
파일: sbd.py 프로젝트: cwjenkins/pcs
 def get_sbd_status(node):
     try:
         status_list.append({
             "node":
             node.label,
             "status":
             json.loads(
                 # here we just need info about sbd service,
                 # therefore watchdog and device list is empty
                 sbd.check_sbd(lib_env.node_communicator(), node, "",
                               []))["sbd"]
         })
         successful_node_list.append(node)
     except NodeCommunicationException as e:
         report_item_list.append(
             node_communicator_exception_to_report_item(
                 e, severity=Severities.WARNING))
         report_item_list.append(
             reports.unable_to_get_sbd_status(
                 node.label,
                 "",  #reason is in previous report item
                 #warning is there implicit
             ))
     except (ValueError, KeyError) as e:
         report_item_list.append(
             reports.unable_to_get_sbd_status(node.label, str(e)))
예제 #2
0
파일: sbd.py 프로젝트: dchirikov/pcs
 def get_sbd_status(node):
     try:
         status_list.append({
             "node": node,
             "status": json.loads(
                 sbd.check_sbd(lib_env.node_communicator(), node, "")
             )["sbd"]
         })
         successful_node_list.append(node)
     except NodeCommunicationException as e:
         report_item_list.append(reports.unable_to_get_sbd_status(
             node.label,
             node_communicator_exception_to_report_item(e).message
         ))
     except (ValueError, KeyError) as e:
         report_item_list.append(reports.unable_to_get_sbd_status(
             node.label, str(e)
         ))
예제 #3
0
파일: sbd.py 프로젝트: miz-take/pcs
 def _process_response(self, response):
     report = response_to_report_item(response,
                                      severity=ReportItemSeverity.WARNING)
     node_label = response.request.target.label
     if report is not None:
         self._report_list([
             report,
             #reason is in previous report item, warning is there implicit
             reports.unable_to_get_sbd_status(node_label, "")
         ])
         return
     try:
         self._status_list.append({
             "node": node_label,
             "status": json.loads(response.data)["sbd"]
         })
         self._successful_target_list.append(node_label)
     except (ValueError, KeyError) as e:
         self._report(reports.unable_to_get_sbd_status(node_label, str(e)))
예제 #4
0
파일: sbd.py 프로젝트: tomjelinek/pcs
 def _process_response(self, response):
     report = response_to_report_item(
         response, severity=ReportItemSeverity.WARNING
     )
     node_label = response.request.target.label
     if report is not None:
         self._report_list([
             report,
             #reason is in previous report item, warning is there implicit
             reports.unable_to_get_sbd_status(node_label, "")
         ])
         return
     try:
         self._status_list.append({
             "node": node_label,
             "status": json.loads(response.data)["sbd"]
         })
         self._successful_target_list.append(node_label)
     except (ValueError, KeyError) as e:
         self._report(reports.unable_to_get_sbd_status(node_label, str(e)))
예제 #5
0
파일: sbd.py 프로젝트: HideoYamauchi/pcs
 def get_sbd_status(node):
     try:
         status_list.append({
             "node": node,
             "status": json.loads(
                 sbd.check_sbd(lib_env.node_communicator(), node, "")
             )["sbd"]
         })
         successful_node_list.append(node)
     except NodeCommunicationException as e:
         report_item_list.append(node_communicator_exception_to_report_item(
             e,
             severity=Severities.WARNING
         ))
         report_item_list.append(reports.unable_to_get_sbd_status(
             node.label,
             "", #reason is in previous report item
             #warning is there implicit
         ))
     except (ValueError, KeyError) as e:
         report_item_list.append(reports.unable_to_get_sbd_status(
             node.label, str(e)
         ))