LUQueryConfigValues supports multiple output fields. If the client asked
for the watcher pause status, it would not get a list, but simply the
value.

Signed-off-by: Michael Hanselmann <[email protected]>
---
 lib/cmdlib.py       |    2 +-
 scripts/gnt-cluster |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 519665c..a56f857 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -3397,7 +3397,7 @@ class LUQueryConfigValues(NoHooksLU):
       elif field == "drain_flag":
         entry = os.path.exists(constants.JOB_QUEUE_DRAIN_FILE)
       elif field == "watcher_pause":
-        return utils.ReadWatcherPauseFile(constants.WATCHER_PAUSEFILE)
+        entry = utils.ReadWatcherPauseFile(constants.WATCHER_PAUSEFILE)
       else:
         raise errors.ParameterError(field)
       values.append(entry)
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index 53bea1a..22f28b7 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -206,6 +206,7 @@ def ShowClusterMaster(opts, args):
   ToStdout(master)
   return 0
 
+
 def _PrintGroupedParams(paramsdict):
   """Print Grouped parameters (be, nic, disk) by group.
 
@@ -218,6 +219,7 @@ def _PrintGroupedParams(paramsdict):
     for item, val in gr_dict.iteritems():
       ToStdout("      %s: %s", item, val)
 
+
 def ShowClusterConfig(opts, args):
   """Shows cluster information.
 
@@ -594,7 +596,7 @@ def WatcherOps(opts, args):
 
   elif command == "info":
     result = client.QueryConfigValues(["watcher_pause"])
-    _ShowWatcherPause(result)
+    _ShowWatcherPause(result[0])
 
   else:
     raise errors.OpPrereqError("Command '%s' is not valid." % command,
-- 
1.6.6

Reply via email to