Revision 069dcc86

b/lib/cmdlib.py
2091 2091
  """Logical unit for querying instances.
2092 2092

  
2093 2093
  """
2094
  _OP_REQP = ["output_fields"]
2094
  _OP_REQP = ["output_fields", "names"]
2095 2095

  
2096 2096
  def CheckPrereq(self):
2097 2097
    """Check prerequisites.
......
2107 2107
                       dynamic=self.dynamic_fields,
2108 2108
                       selected=self.op.output_fields)
2109 2109

  
2110
    self.wanted = _GetWantedInstances(self, self.op.names)
2111

  
2110 2112
  def Exec(self, feedback_fn):
2111 2113
    """Computes the list of nodes and their attributes.
2112 2114

  
2113 2115
    """
2114
    instance_names = utils.NiceSort(self.cfg.GetInstanceList())
2116
    instance_names = self.wanted
2115 2117
    instance_list = [self.cfg.GetInstanceInfo(iname) for iname
2116 2118
                     in instance_names]
2117 2119

  
b/lib/opcodes.py
202 202
class OpQueryInstances(OpCode):
203 203
  """Compute the list of instances."""
204 204
  OP_ID = "OP_INSTANCE_QUERY"
205
  __slots__ = ["output_fields"]
205
  __slots__ = ["output_fields", "names"]
206 206

  
207 207

  
208 208
class OpQueryInstanceData(OpCode):
b/scripts/gnt-instance
41 41
  else:
42 42
    selected_fields = opts.output.split(",")
43 43

  
44
  op = opcodes.OpQueryInstances(output_fields=selected_fields)
44
  op = opcodes.OpQueryInstances(output_fields=selected_fields, names=[])
45 45
  output = SubmitOpCode(op)
46 46

  
47 47
  if not opts.no_headers:

Also available in: Unified diff