Revision 3ccafd0e scripts/gnt-cluster

b/scripts/gnt-cluster
343 343
  return 0
344 344

  
345 345

  
346
def QueueOps(opts, args):
347
  """Queue operations.
348

  
349
  """
350
  command = args[0]
351
  client = GetClient()
352
  if command in ("drain", "undrain"):
353
    drain_flag = command == "drain"
354
    client.SetQueueDrainFlag(drain_flag)
355
  elif command == "info":
356
    result = client.QueryConfigValues(["drain_flag"])
357
    print "The drain flag is",
358
    if result[0]:
359
      print "set"
360
    else:
361
      print "unset"
362
  return 0
363

  
346 364
# this is an option common to more than one command, so we declare
347 365
# it here and reuse it
348 366
node_option = make_option("-n", "--node", action="append", dest="nodes",
......
443 461
  'search-tags': (SearchTags, ARGS_ONE,
444 462
                  [DEBUG_OPT], "", "Searches the tags on all objects on"
445 463
                  " the cluster for a given pattern (regex)"),
464
  'queue': (QueueOps, ARGS_ONE, [DEBUG_OPT],
465
            "drain|undrain|info", "Change queue properties"),
446 466
  'modify': (SetClusterParams, ARGS_NONE,
447 467
             [DEBUG_OPT,
448 468
              make_option("-g", "--vg-name", dest="vg_name",

Also available in: Unified diff