Revision 4edc512c lib/client/gnt_group.py
b/lib/client/gnt_group.py | ||
---|---|---|
26 | 26 |
|
27 | 27 |
from ganeti.cli import * |
28 | 28 |
from ganeti import compat |
29 |
from ganeti import utils |
|
29 | 30 |
|
30 | 31 |
|
31 | 32 |
#: default list of fields for L{ListGroups} |
... | ... | |
37 | 38 |
"name": "Group", "uuid": "UUID", |
38 | 39 |
"node_cnt": "Nodes", "node_list": "NodeList", |
39 | 40 |
"pinst_cnt": "Instances", "pinst_list": "InstanceList", |
41 |
"ctime": "CTime", "mtime": "MTime", "serial_no": "SerialNo", |
|
40 | 42 |
} |
41 | 43 |
|
42 | 44 |
|
... | ... | |
59 | 61 |
else: |
60 | 62 |
headers = _LIST_HEADERS |
61 | 63 |
|
62 |
int_type_fields = frozenset(["node_cnt", "pinst_cnt"]) |
|
64 |
int_type_fields = frozenset(["node_cnt", "pinst_cnt", "serial_no"])
|
|
63 | 65 |
list_type_fields = frozenset(["node_list", "pinst_list"]) |
66 |
date_type_fields = frozenset(["mtime", "ctime"]) |
|
64 | 67 |
|
65 | 68 |
for row in output: |
66 | 69 |
for idx, field in enumerate(desired_fields): |
... | ... | |
70 | 73 |
val = ",".join(val) |
71 | 74 |
elif opts.roman_integers and field in int_type_fields: |
72 | 75 |
val = compat.TryToRoman(val) |
76 |
elif field in date_type_fields: |
|
77 |
val = utils.FormatTime(val) |
|
73 | 78 |
elif val is None: |
74 | 79 |
val = "?" |
75 | 80 |
|
... | ... | |
88 | 93 |
"list": ( |
89 | 94 |
ListGroups, ARGS_MANY_GROUPS, |
90 | 95 |
[NOHDR_OPT, SEP_OPT, FIELDS_OPT, SYNC_OPT, ROMAN_OPT], |
91 |
"[<group_name>...]", "Lists the node groups in the cluster."), |
|
96 |
"[<group_name>...]", |
|
97 |
"Lists the node groups in the cluster. The available fields are (see" |
|
98 |
" the man page for details): %s. The default list is (in order): %s." % |
|
99 |
(utils.CommaJoin(_LIST_HEADERS), utils.CommaJoin(_LIST_DEF_FIELDS))), |
|
92 | 100 |
} |
93 | 101 |
|
94 | 102 |
|
Also available in: Unified diff