def test_success(self): mock_communicator = mock.MagicMock(spec_set=NodeCommunicator) node = NodeAddresses("node1") lib_sbd.get_sbd_config(mock_communicator, node) mock_communicator.call_node.assert_called_once_with( node, "remote/get_sbd_config", None )
def get_sbd_config(node): try: config_list.append({ "node": node, "config": environment_file_to_dict( sbd.get_sbd_config(lib_env.node_communicator(), node) ) }) successful_node_list.append(node) except NodeCommandUnsuccessfulException as e: report_item_list.append(reports.unable_to_get_sbd_config( node.label, e.reason, Severities.WARNING )) 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_config( node.label, "", #reason is in previous report item Severities.WARNING ))