Revision beb81ea5 lib/query.py
b/lib/query.py | ||
---|---|---|
2494 | 2494 |
|
2495 | 2495 |
_NETWORK_STATS_FIELDS = { |
2496 | 2496 |
"free_count": ("FreeCount", QFT_NUMBER, 0, "How many addresses are free"), |
2497 |
"reserved_count": ("ReservedCount", QFT_NUMBER, 0, "How many addresses are reserved"), |
|
2497 |
"reserved_count": ("ReservedCount", QFT_NUMBER, 0, |
|
2498 |
"How many addresses are reserved"), |
|
2498 | 2499 |
"map": ("Map", QFT_TEXT, 0, "The actual mapping"), |
2499 |
"external_reservations": ("ExternalReservations", QFT_TEXT, 0, "The external reservations"), |
|
2500 |
"external_reservations": ("ExternalReservations", QFT_TEXT, 0, |
|
2501 |
"The external reservations"), |
|
2500 | 2502 |
} |
2501 | 2503 |
|
2502 |
|
|
2503 |
def _GetNetworkStatsField(field, kind, ctx, net): |
|
2504 |
def _GetNetworkStatsField(field, kind, ctx): |
|
2504 | 2505 |
"""Gets the value of a "stats" field from L{NetworkQueryData}. |
2505 | 2506 |
|
2506 | 2507 |
@param field: Field name |
... | ... | |
2541 | 2542 |
fields.extend([ |
2542 | 2543 |
(_MakeField(name, title, kind, doc), |
2543 | 2544 |
NETQ_CONFIG, 0, _GetItemAttr(name)) |
2544 |
for (name, (title, kind, flags, doc)) in _NETWORK_SIMPLE_FIELDS.items()
|
|
2545 |
for (name, (title, kind, _, doc)) in _NETWORK_SIMPLE_FIELDS.items()
|
|
2545 | 2546 |
]) |
2546 | 2547 |
|
2547 | 2548 |
def _GetLength(getter): |
... | ... | |
2573 | 2574 |
fields.extend([ |
2574 | 2575 |
(_MakeField(name, title, kind, doc), NETQ_STATS, 0, |
2575 | 2576 |
compat.partial(_GetNetworkStatsField, name, kind)) |
2576 |
for (name, (title, kind, flags, doc)) in _NETWORK_STATS_FIELDS.items()
|
|
2577 |
for (name, (title, kind, _, doc)) in _NETWORK_STATS_FIELDS.items()
|
|
2577 | 2578 |
]) |
2578 | 2579 |
|
2579 | 2580 |
return _PrepareFieldList(fields, []) |
Also available in: Unified diff