From 5ffaa51d83a8b1e0cb70d7818f87360c89fe00f3 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 29 Jan 2009 15:09:11 +0000
Subject: [PATCH] gnt-instance list: accept input names

Currently gnt-instance list will refuse to take arguments, and always
return the full list of instances. This patch allows it to pass names to
LUQueryInstances, so that we restrict the input to a given set of
instances.

Reviewed-by: ultrotter
---
 scripts/gnt-instance | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 57091e6c8..1ee42a3d4 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -214,7 +214,7 @@ def ListInstances(opts, args):
   else:
     selected_fields = opts.output.split(",")
 
-  output = GetClient().QueryInstances([], selected_fields)
+  output = GetClient().QueryInstances(args, selected_fields)
 
   if not opts.no_headers:
     headers = {
@@ -1367,8 +1367,9 @@ commands = {
                         help="Only show configuration data, not runtime data"),
             ], "[-s] [<instance>...]",
            "Show information on the specified instance(s)"),
-  'list': (ListInstances, ARGS_NONE,
-           [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], "",
+  'list': (ListInstances, ARGS_ANY,
+           [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
+           "[<instance>...]",
            "Lists the instances and their status. The available fields are"
            " (see the man page for details): status, oper_state, oper_ram,"
            " name, os, pnode, snodes, admin_state, admin_ram, disk_template,"
-- 
GitLab