Revision aa29e95f lib/cmdlib.py

b/lib/cmdlib.py
39 39
import socket
40 40
import tempfile
41 41
import shutil
42
import operator
43 42
import itertools
44 43

  
45 44
from ganeti import ssh
......
559 558
    @return: List of L{objects.QueryFieldDefinition}
560 559

  
561 560
    """
562
    if fields is None:
563
      # Client requests all fields, sort by name
564
      fdefs = sorted(query.GetAllFields(cls.FIELDS.values()),
565
                     key=operator.attrgetter("name"))
566
    else:
567
      # Keep order as requested by client
568
      fdefs = query.Query(cls.FIELDS, fields).GetFields()
569

  
570
    return objects.QueryFieldsResponse(fields=fdefs).ToDict()
561
    return query.QueryFields(cls.FIELDS, fields)
571 562

  
572 563
  def ExpandNames(self, lu):
573 564
    """Expand names for this query.

Also available in: Unified diff