From dff92f778f692f0ec2aa7d0c20e76a06a767e4b2 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Fri, 24 Jun 2016 20:17:38 +0200
Subject: [PATCH] bz1164402-01 sbd fix call_node calls on python3
---
pcs/lib/sbd.py | 14 +++++++-------
pcs/test/test_lib_sbd.py | 10 +++++-----
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/pcs/lib/sbd.py b/pcs/lib/sbd.py
index 1330bfc..4488a73 100644
--- a/pcs/lib/sbd.py
+++ b/pcs/lib/sbd.py
@@ -57,7 +57,7 @@ def check_sbd(communicator, node, watchdog):
return communicator.call_node(
node,
"remote/check_sbd",
- NodeCommunicator.format_data_dict({"watchdog": watchdog})
+ NodeCommunicator.format_data_dict([("watchdog", watchdog)])
)
@@ -119,7 +119,7 @@ def set_sbd_config(communicator, node, config):
communicator.call_node(
node,
"remote/set_sbd_config",
- NodeCommunicator.format_data_dict({"config": config})
+ NodeCommunicator.format_data_dict([("config", config)])
)
@@ -171,7 +171,7 @@ def enable_sbd_service(communicator, node):
communicator -- NodeCommunicator
node -- NodeAddresses
"""
- communicator.call_node(node, "remote/sbd_enable", "")
+ communicator.call_node(node, "remote/sbd_enable", None)
def enable_sbd_service_on_node(report_processor, node_communicator, node):
@@ -215,7 +215,7 @@ def disable_sbd_service(communicator, node):
communicator -- NodeCommunicator
node -- NodeAddresses
"""
- communicator.call_node(node, "remote/sbd_disable", "")
+ communicator.call_node(node, "remote/sbd_disable", None)
def disable_sbd_service_on_node(report_processor, node_communicator, node):
@@ -259,7 +259,7 @@ def set_stonith_watchdog_timeout_to_zero(communicator, node):
node -- NodeAddresses
"""
communicator.call_node(
- node, "remote/set_stonith_watchdog_timeout_to_zero", ""
+ node, "remote/set_stonith_watchdog_timeout_to_zero", None
)
@@ -292,7 +292,7 @@ def remove_stonith_watchdog_timeout(communicator, node):
communicator -- NodeCommunicator
node -- NodeAddresses
"""
- communicator.call_node(node, "remote/remove_stonith_watchdog_timeout", "")
+ communicator.call_node(node, "remote/remove_stonith_watchdog_timeout", None)
def remove_stonith_watchdog_timeout_on_all_nodes(node_communicator, node_list):
@@ -351,7 +351,7 @@ def get_sbd_config(communicator, node):
communicator -- NodeCommunicator
node -- NodeAddresses
"""
- return communicator.call_node(node, "remote/get_sbd_config", "")
+ return communicator.call_node(node, "remote/get_sbd_config", None)
def is_sbd_enabled(runner):
diff --git a/pcs/test/test_lib_sbd.py b/pcs/test/test_lib_sbd.py
index 54c5669..e3c1401 100644
--- a/pcs/test/test_lib_sbd.py
+++ b/pcs/test/test_lib_sbd.py
@@ -360,7 +360,7 @@ class EnableSbdServiceTest(TestCase):
node = NodeAddresses("node1")
lib_sbd.enable_sbd_service(mock_communicator, node)
mock_communicator.call_node.assert_called_once_with(
- node, "remote/sbd_enable", ""
+ node, "remote/sbd_enable", None
)
@@ -408,7 +408,7 @@ class DisableSbdServiceTest(TestCase):
node = NodeAddresses("node1")
lib_sbd.disable_sbd_service(mock_communicator, node)
mock_communicator.call_node.assert_called_once_with(
- node, "remote/sbd_disable", ""
+ node, "remote/sbd_disable", None
)
@@ -456,7 +456,7 @@ class SetStonithWatchdogTimeoutToZeroTest(TestCase):
node = NodeAddresses("node1")
lib_sbd.set_stonith_watchdog_timeout_to_zero(mock_communicator, node)
mock_communicator.call_node.assert_called_once_with(
- node, "remote/set_stonith_watchdog_timeout_to_zero", ""
+ node, "remote/set_stonith_watchdog_timeout_to_zero", None
)
@@ -520,7 +520,7 @@ class RemoveStonithWatchdogTimeoutTest(TestCase):
node = NodeAddresses("node1")
lib_sbd.remove_stonith_watchdog_timeout(mock_communicator, node)
mock_communicator.call_node.assert_called_once_with(
- node, "remote/remove_stonith_watchdog_timeout", ""
+ node, "remote/remove_stonith_watchdog_timeout", None
)
@@ -584,7 +584,7 @@ class GetSbdConfigTest(TestCase):
node = NodeAddresses("node1")
lib_sbd.get_sbd_config(mock_communicator, node)
mock_communicator.call_node.assert_called_once_with(
- node, "remote/get_sbd_config", ""
+ node, "remote/get_sbd_config", None
)
--
1.8.3.1