Rename a few instance field titles
authorIustin Pop <iustin@google.com>
Sun, 16 Jan 2011 15:23:45 +0000 (16:23 +0100)
committerIustin Pop <iustin@google.com>
Tue, 18 Jan 2011 15:55:48 +0000 (16:55 +0100)
The conversion to querylib introduced unique field titles, which however
did an inconsistent rename of the instance vcpus/memory fields.

This patch makes both BE_MEMORY and _VCPUS be named with prefix “Config”
(which before was “Configured_”), and drops the “Runtime” (note no
underscore) prefix on the oper_ ones.

Rationale: for numeric fields, the width of the title defines the width
of the columns, as the numbers are usually small. Hence these columns
(more likely used than the BE ones) would be very wide, leading to a
not-so-nice display. I happened upon this when my terminals didn't
manage to fit a gnt-instance list anymore.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

lib/query.py

index 5a86e1c..937b4d3 100644 (file)
@@ -998,8 +998,8 @@ def _GetInstanceParameterFields():
   # TODO: Consider moving titles closer to constants
   be_title = {
     constants.BE_AUTO_BALANCE: "Auto_balance",
-    constants.BE_MEMORY: "Configured_memory",
-    constants.BE_VCPUS: "VCPUs",
+    constants.BE_MEMORY: "ConfigMemory",
+    constants.BE_VCPUS: "ConfigVCPUs",
     }
 
   hv_title = {
@@ -1093,9 +1093,9 @@ def _BuildInstanceFields():
   fields.extend([
     (_MakeField("oper_state", "Running", QFT_BOOL), IQ_LIVE,
      _GetInstOperState),
-    (_MakeField("oper_ram", "RuntimeMemory", QFT_UNIT), IQ_LIVE,
+    (_MakeField("oper_ram", "Memory", QFT_UNIT), IQ_LIVE,
      _GetInstLiveData("memory")),
-    (_MakeField("oper_vcpus", "RuntimeVCPUs", QFT_NUMBER), IQ_LIVE,
+    (_MakeField("oper_vcpus", "VCPUs", QFT_NUMBER), IQ_LIVE,
      _GetInstLiveData("vcpus")),
     (_MakeField("status", "Status", QFT_TEXT), IQ_LIVE, _GetInstStatus),
     ])