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)))
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) ))
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)))
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)))
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) ))