Commit cac599f1 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix bug in LUQueryConfigValues



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: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 30bb62ea
......@@ -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)
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment