Added a few tweaks to the performance management cli. Sorting of fields
for non list types (non repeated). Omitted some fields that were likely
not displayed previously for the logical device.
Change-Id: I5ef5e19bca4af97c2e308a3495c02385ef5966bf
diff --git a/cli/logical_device.py b/cli/logical_device.py
index 24508df..9efd6ae 100644
--- a/cli/logical_device.py
+++ b/cli/logical_device.py
@@ -89,6 +89,8 @@
'ofp_port.advertised',
'ofp_port.peer',
'ofp_port.max_speed',
+ 'ofp_port.supported',
+ 'ofp_port.config'
}
print_pb_list_as_table('Logical device ports:', device.ports,
omit_fields, self.poutput)
diff --git a/cli/table.py b/cli/table.py
index 1a1f576..6db53bc 100644
--- a/cli/table.py
+++ b/cli/table.py
@@ -123,7 +123,7 @@
t.add_cell(_row, number + field_number, fname,
d.get(field))
#t.add_cell(_row, number + field.number, fname,
- #d.get(field.name))
+ # d.get(field.name))
field_number += 1
add(row, obj)
@@ -138,8 +138,14 @@
def pr(_pb, prefix=''):
d = pb2dict(_pb)
+ l=[]
+ for field in sorted(pb._fields, key=lambda f: f.number):
+ l.append(field.name)
+ for field in d:
+ if field not in l:
+ l.append(field)
#for field in sorted(_pb._fields, key=lambda f: f.number):
- for field in sorted(d):
+ for field in sorted(d, key=lambda f: l.index(f)):
#fname = prefix + field.name
fname = prefix + field
if fname in fields_to_omit: