@@ -1079,43 +1079,26 @@ def test_is_quorate(mock_run):
1079
1079
mock_run_inst .get_stdout_or_raise_error .assert_called_once_with ("corosync-quorumtool -s" , None , success_exit_status = {0 , 2 })
1080
1080
1081
1081
1082
- @mock .patch ('crmsh.utils.get_address_list_from_corosync_conf' )
1083
1082
@mock .patch ('crmsh.utils.etree.fromstring' )
1084
1083
@mock .patch ('crmsh.sh.ShellUtils.get_stdout_stderr' )
1085
- def test_list_cluster_nodes_none (mock_run , mock_etree , mock_corosync ):
1084
+ def test_list_cluster_nodes_none (mock_run , mock_etree ):
1086
1085
mock_run .return_value = (0 , "data" , None )
1087
1086
mock_etree .return_value = None
1088
- mock_corosync .return_value = ["node1" , "node2" ]
1089
1087
res = utils .list_cluster_nodes ()
1090
- assert res == [ "node1" , "node2" ]
1088
+ assert res is None
1091
1089
mock_run .assert_called_once_with (constants .CIB_QUERY , no_reg = False )
1092
1090
mock_etree .assert_called_once_with ("data" )
1093
1091
1094
1092
1095
- @mock .patch ('crmsh.utils.get_address_list_from_corosync_conf' )
1096
- @mock .patch ('crmsh.utils.etree.fromstring' )
1097
- @mock .patch ('crmsh.sh.ShellUtils.get_stdout_stderr' )
1098
- def test_list_cluster_nodes_none_no_reg (mock_run , mock_etree , mock_corosync ):
1099
- mock_run .return_value = (0 , "data" , None )
1100
- mock_etree .return_value = None
1101
- mock_corosync .return_value = ["node1" , "node2" ]
1102
- res = utils .list_cluster_nodes (no_reg = True )
1103
- assert res == ["node1" , "node2" ]
1104
- mock_run .assert_called_once_with (constants .CIB_QUERY , no_reg = True )
1105
- mock_etree .assert_called_once_with ("data" )
1106
-
1107
-
1108
- @mock .patch ('crmsh.utils.get_address_list_from_corosync_conf' )
1109
1093
@mock .patch ('os.path.isfile' )
1110
1094
@mock .patch ('os.getenv' )
1111
1095
@mock .patch ('crmsh.sh.ShellUtils.get_stdout_stderr' )
1112
- def test_list_cluster_nodes_cib_not_exist (mock_run , mock_env , mock_isfile , mock_corosync ):
1096
+ def test_list_cluster_nodes_cib_not_exist (mock_run , mock_env , mock_isfile ):
1113
1097
mock_run .return_value = (1 , None , None )
1114
1098
mock_env .return_value = constants .CIB_RAW_FILE
1115
1099
mock_isfile .return_value = False
1116
- mock_corosync .return_value = ["node1" , "node2" ]
1117
1100
res = utils .list_cluster_nodes ()
1118
- assert res == [ "node1" , "node2" ]
1101
+ assert res is None
1119
1102
mock_run .assert_called_once_with (constants .CIB_QUERY , no_reg = False )
1120
1103
mock_env .assert_called_once_with ("CIB_file" , constants .CIB_RAW_FILE )
1121
1104
mock_isfile .assert_called_once_with (constants .CIB_RAW_FILE )
0 commit comments