[Pkg-ganeti-devel] [ganeti] 77/165: Add 'metad echo' command to gnt-debug
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit 50ee9f438c4d56e4f072cade570dfe70bd00100a
Author: Petr Pudlak <pudlak at google.com>
Date: Mon Mar 2 19:19:48 2015 +0100
Add 'metad echo' command to gnt-debug
This allows testing the basic responsiveness of the metadata daemon.
Signed-off-by: Petr Pudlak <pudlak at google.com>
Reviewed-by: Klaus Aehlig <aehlig at google.com>
---
lib/client/gnt_debug.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/lib/client/gnt_debug.py b/lib/client/gnt_debug.py
index 9b36ceb..d05fbc2 100644
--- a/lib/client/gnt_debug.py
+++ b/lib/client/gnt_debug.py
@@ -47,6 +47,7 @@ from ganeti import utils
from ganeti import errors
from ganeti import compat
from ganeti import ht
+from ganeti import metad
from ganeti import wconfd
@@ -632,6 +633,29 @@ def ListLocks(opts, args): # pylint: disable=W0613
return 0
+def Metad(opts, args): # pylint: disable=W0613
+ """Send commands to Metad.
+
+ @param opts: the command line options selected by the user
+ @type args: list
+ @param args: the command to send, followed by the command-specific arguments
+ @rtype: int
+ @return: the desired exit code
+
+ """
+ if args[0] == "echo":
+ if len(args) != 2:
+ ToStderr("Command 'echo' takes only precisely argument.")
+ return 1
+ result = metad.Client().Echo(args[1])
+ print "Answer: %s" % (result,)
+ else:
+ ToStderr("Command '%s' not supported", args[0])
+ return 1
+
+ return 0
+
+
def Wconfd(opts, args): # pylint: disable=W0613
"""Send commands to WConfD.
@@ -768,6 +792,9 @@ commands = {
"wconfd": (
Wconfd, [ArgUnknown(min=1)], [],
"<cmd> <args...>", "Directly talk to WConfD"),
+ "metad": (
+ Metad, [ArgUnknown(min=1)], [],
+ "<cmd> <args...>", "Directly talk to Metad"),
}
#: dictionary with aliases for commands
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list