From 7ef40fbe1adcc60aa46104e2193aad0aefc6d9b4 Mon Sep 17 00:00:00 2001
From: Luca Bigliardi <shammash@google.com>
Date: Thu, 24 Jun 2010 11:02:23 +0100
Subject: [PATCH] VerifyNode: add usermode helper reply

Signed-off-by: Luca Bigliardi <shammash@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/backend.py   | 10 ++++++++++
 lib/constants.py |  1 +
 2 files changed, 11 insertions(+)

diff --git a/lib/backend.py b/lib/backend.py
index 0e3c2e244..c6e5c30c4 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -584,6 +584,16 @@ def VerifyNode(what, cluster_name):
       used_minors = str(err)
     result[constants.NV_DRBDLIST] = used_minors
 
+  if constants.NV_DRBDHELPER in what:
+    status = True
+    try:
+      payload = bdev.BaseDRBD.GetUsermodeHelper()
+    except errors.BlockDeviceError, err:
+      logging.error("Can't get DRBD usermode helper: %s", str(err))
+      status = False
+      payload = str(err)
+    result[constants.NV_DRBDHELPER] = (status, payload)
+
   if constants.NV_NODESETUP in what:
     result[constants.NV_NODESETUP] = tmpr = []
     if not os.path.isdir("/sys/block") or not os.path.isdir("/sys/class/net"):
diff --git a/lib/constants.py b/lib/constants.py
index 760f46d0f..4e388b8bc 100644
--- a/lib/constants.py
+++ b/lib/constants.py
@@ -718,6 +718,7 @@ VERIFY_NPLUSONE_MEM = 'nplusone_mem'
 VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
 
 # Node verify constants
+NV_DRBDHELPER = "drbd-helper"
 NV_DRBDLIST = "drbd-list"
 NV_FILELIST = "filelist"
 NV_HVINFO = "hvinfo"
-- 
GitLab