Exemple #1
0
 def test_success(self):
     mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
     node = NodeAddresses("node1")
     lib_sbd.check_sbd(mock_communicator, node, "/dev/watchdog")
     mock_communicator.call_node.assert_called_once_with(
         node, "remote/check_sbd", "watchdog=%2Fdev%2Fwatchdog"
     )
Exemple #2
0
 def test_success(self):
     mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
     node = NodeAddresses("node1")
     lib_sbd.check_sbd(mock_communicator, node, "/dev/watchdog",
                       ["/dev/sdb1", "/dev/sdc"])
     mock_communicator.call_node.assert_called_once_with(
         node, "remote/check_sbd", "watchdog=%2Fdev%2Fwatchdog&" +\
         "device_list=%5B%22%2Fdev%2Fsdb1%22%2C+%22%2Fdev%2Fsdc%22%5D"
     )
Exemple #3
0
 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)))
Exemple #4
0
 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)
         ))
Exemple #5
0
 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)
         ))
Exemple #6
0
 def test_success(self):
     mock_communicator = mock.MagicMock(spec_set=NodeCommunicator)
     node = NodeAddresses("node1")
     lib_sbd.check_sbd(mock_communicator, node, "/dev/watchdog")
     mock_communicator.call_node.assert_called_once_with(
         node, "remote/check_sbd", "watchdog=%2Fdev%2Fwatchdog")