Signed-off-by: Luca Bigliardi <[email protected]>
---
lib/config.py | 16 ++++++++++++++++
lib/objects.py | 1 +
test/ganeti.config_unittest.py | 1 +
3 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/config.py b/lib/config.py
index 98cb0fd..c81f201 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -1420,6 +1420,22 @@ class ConfigWriter:
self._WriteConfig()
@locking.ssynchronized(_config_lock, shared=1)
+ def GetDRBDHelper(self):
+ """Return DRBD usermode helper.
+
+ """
+ return self._config_data.cluster.drbd_usermode_helper
+
+ @locking.ssynchronized(_config_lock)
+ def SetDRBDHelper(self, drbd_helper):
+ """Set DRBD usermode helper.
+
+ """
+ self._config_data.cluster.drbd_usermode_helper = drbd_helper
+ self._config_data.cluster.serial_no += 1
+ self._WriteConfig()
+
+ @locking.ssynchronized(_config_lock, shared=1)
def GetMACPrefix(self):
"""Return the mac prefix.
diff --git a/lib/objects.py b/lib/objects.py
index 185bb48..adb2756 100644
--- a/lib/objects.py
+++ b/lib/objects.py
@@ -862,6 +862,7 @@ class Cluster(TaggableObject):
"tcpudp_port_pool",
"mac_prefix",
"volume_group_name",
+ "drbd_usermode_helper",
"default_bridge",
"default_hypervisor",
"master_node",
diff --git a/test/ganeti.config_unittest.py b/test/ganeti.config_unittest.py
index 6f3b065..3cbace2 100755
--- a/test/ganeti.config_unittest.py
+++ b/test/ganeti.config_unittest.py
@@ -68,6 +68,7 @@ class TestConfigRunner(unittest.TestCase):
highest_used_port=(constants.FIRST_DRBD_PORT - 1),
mac_prefix="aa:00:00",
volume_group_name="xenvg",
+ drbd_usermode_helper="/bin/true",
nicparams={constants.PP_DEFAULT: constants.NICC_DEFAULTS},
tcpudp_port_pool=set(),
enabled_hypervisors=[constants.HT_FAKE],
--
1.7.1