From 96897af726596e8ee49ecdb19aac7b4e83c1585f Mon Sep 17 00:00:00 2001
From: Alexander Schreiber <als@google.com>
Date: Tue, 17 Apr 2012 16:47:53 +0200
Subject: [PATCH] Add "show" as alias for "info" to gnt commands

This patch adds support for "show" as an alias for "info" to
gnt-(cluster|instance|node|os). It already exists in gnt-job.

Signed-off-by: Alexander Schreiber <als@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/client/gnt_cluster.py  | 1 +
 lib/client/gnt_instance.py | 1 +
 lib/client/gnt_node.py     | 8 +++++++-
 lib/client/gnt_os.py       | 7 ++++++-
 4 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py
index 10d770985..f1bedceba 100644
--- a/lib/client/gnt_cluster.py
+++ b/lib/client/gnt_cluster.py
@@ -1579,6 +1579,7 @@ commands = {
 #: dictionary with aliases for commands
 aliases = {
   "masterfailover": "master-failover",
+  "show": "info",
 }
 
 
diff --git a/lib/client/gnt_instance.py b/lib/client/gnt_instance.py
index 367c4f820..0f70021e8 100644
--- a/lib/client/gnt_instance.py
+++ b/lib/client/gnt_instance.py
@@ -1662,6 +1662,7 @@ commands = {
 aliases = {
   "start": "startup",
   "stop": "shutdown",
+  "show": "info",
   }
 
 
diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py
index 07502466b..888d97658 100644
--- a/lib/client/gnt_node.py
+++ b/lib/client/gnt_node.py
@@ -987,7 +987,13 @@ commands = {
     "[<node_name>...]", "List health of node(s) using out-of-band"),
   }
 
+#: dictionary with aliases for commands
+aliases = {
+  "show": "info",
+  }
+
 
 def Main():
-  return GenericMain(commands, override={"tag_type": constants.TAG_NODE},
+  return GenericMain(commands, aliases=aliases,
+                     override={"tag_type": constants.TAG_NODE},
                      env_override=_ENV_OVERRIDE)
diff --git a/lib/client/gnt_os.py b/lib/client/gnt_os.py
index 3554524ff..890becc7f 100644
--- a/lib/client/gnt_os.py
+++ b/lib/client/gnt_os.py
@@ -297,6 +297,11 @@ commands = {
     "", "Modify the OS parameters"),
   }
 
+#: dictionary with aliases for commands
+aliases = {
+  "show": "info",
+  }
+
 
 def Main():
-  return GenericMain(commands)
+  return GenericMain(commands, aliases=aliases)
-- 
GitLab