Revision 83d4ba5e lib/client/gnt_instance.py
b/lib/client/gnt_instance.py | ||
---|---|---|
25 | 25 |
# W0614: Unused import %s from wildcard import (since we need cli) |
26 | 26 |
# C0103: Invalid name gnt-instance |
27 | 27 |
|
28 |
import copy |
|
28 | 29 |
import itertools |
29 | 30 |
import simplejson |
30 | 31 |
import logging |
... | ... | |
1249 | 1250 |
FormatParameterDict(buf, instance["hv_instance"], instance["hv_actual"], |
1250 | 1251 |
level=2) |
1251 | 1252 |
buf.write(" Hardware:\n") |
1252 |
buf.write(" - VCPUs: %s\n" % |
|
1253 |
compat.TryToRoman(instance["be_actual"][constants.BE_VCPUS], |
|
1254 |
convert=opts.roman_integers)) |
|
1255 |
buf.write(" - maxmem: %sMiB\n" % |
|
1256 |
compat.TryToRoman(instance["be_actual"][constants.BE_MAXMEM], |
|
1257 |
convert=opts.roman_integers)) |
|
1258 |
buf.write(" - minmem: %sMiB\n" % |
|
1259 |
compat.TryToRoman(instance["be_actual"][constants.BE_MINMEM], |
|
1260 |
convert=opts.roman_integers)) |
|
1261 | 1253 |
# deprecated "memory" value, kept for one version for compatibility |
1262 | 1254 |
# TODO(ganeti 2.7) remove. |
1263 |
buf.write(" - memory: %sMiB\n" % |
|
1264 |
compat.TryToRoman(instance["be_actual"][constants.BE_MAXMEM], |
|
1265 |
convert=opts.roman_integers)) |
|
1266 |
buf.write(" - %s: %s\n" % |
|
1267 |
(constants.BE_ALWAYS_FAILOVER, |
|
1268 |
instance["be_actual"][constants.BE_ALWAYS_FAILOVER])) |
|
1255 |
be_actual = copy.deepcopy(instance["be_actual"]) |
|
1256 |
be_actual["memory"] = be_actual[constants.BE_MAXMEM] |
|
1257 |
FormatParameterDict(buf, instance["be_instance"], be_actual, level=2) |
|
1258 |
# TODO(ganeti 2.7) rework the NICs as well |
|
1269 | 1259 |
buf.write(" - NICs:\n") |
1270 | 1260 |
for idx, (ip, mac, mode, link) in enumerate(instance["nics"]): |
1271 | 1261 |
buf.write(" - nic/%d: MAC: %s, IP: %s, mode: %s, link: %s\n" % |
Also available in: Unified diff