Fix bug in LUQueryConfigValues
authorMichael Hanselmann <hansmi@google.com>
Fri, 26 Feb 2010 09:03:54 +0000 (10:03 +0100)
committerMichael Hanselmann <hansmi@google.com>
Fri, 26 Feb 2010 12:38:44 +0000 (13:38 +0100)
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 <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py
scripts/gnt-cluster

index 519665c..a56f857 100644 (file)
@@ -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)
index 53bea1a..22f28b7 100755 (executable)
@@ -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,