mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-12 18:59:06 +00:00
Provide some more friendly string values
Some keys from the API are a little weird, provide a mapping for them.
This commit is contained in:
parent
b5fbfe730d
commit
129f034c07
@ -25,6 +25,13 @@ if path.startswith('/opt'):
|
||||
import confluent.client as client
|
||||
|
||||
|
||||
def pretty(text):
|
||||
if text == 'pcislot':
|
||||
return 'PCI slot'
|
||||
if text == 'partnumber':
|
||||
return 'part number'
|
||||
return text
|
||||
|
||||
def print_mem_info(node, prefix, meminfo):
|
||||
capacity = meminfo['capacity_mb'] / 1024
|
||||
memdescfmt = '{0}GB PC'
|
||||
@ -76,7 +83,8 @@ try:
|
||||
for datum in info:
|
||||
if info[datum] is None:
|
||||
continue
|
||||
print('{0}: {1} {2}: {3}'.format(node, prefix, datum,
|
||||
print('{0}: {1} {2}: {3}'.format(node, prefix,
|
||||
pretty(datum),
|
||||
info[datum]))
|
||||
exitcode = 0
|
||||
sys.exit(
|
||||
|
Loading…
x
Reference in New Issue
Block a user