Revision f33307bd

b/lib/client/gnt_debug.py
38 38
from ganeti import errors
39 39
from ganeti import compat
40 40
from ganeti import ht
41
from ganeti import wconfd
41 42

  
42 43

  
43 44
#: Default fields for L{ListLocks}
......
620 621
  return 0
621 622

  
622 623

  
624
def Wconfd(opts, args): # pylint: disable=W0613
625
  """Send commands to WConfD.
626

  
627
  @param opts: the command line options selected by the user
628
  @type args: list
629
  @param args: the command to send, followed by the command-specific arguments
630
  @rtype: int
631
  @return: the desired exit code
632

  
633
  """
634
  if args[0] == "echo":
635
    if len(args) != 2:
636
      ToStderr("Command 'echo' takes only precisely argument.")
637
      return 1
638
    result = wconfd.Client().Echo(args[1])
639
    print "Answer: %s" % (result,)
640
  else:
641
    ToStderr("Command '%s' not supported", args[0])
642
    return 1
643

  
644
  return 0
645

  
646

  
623 647
commands = {
624 648
  "delay": (
625 649
    Delay, [ArgUnknown(min=1, max=1)],
......
691 715
    ListLocks, ARGS_NONE,
692 716
    [NOHDR_OPT, SEP_OPT, FIELDS_OPT, INTERVAL_OPT, VERBOSE_OPT],
693 717
    "[--interval N]", "Show a list of locks in the master daemon"),
718
  "wconfd": (
719
    Wconfd, [ArgUnknown(min=1)], [],
720
    "<cmd> <args...>", "Directly talk to WConfD"),
694 721
  }
695 722

  
696 723
#: dictionary with aliases for commands

Also available in: Unified diff