Many CLI cleanups and flow preintegration
Changes:
- auto-completion for device and logical device IDs
- a set of test CLI commands to push down various flows
to Voltha (aids test and integration)
- sample code in simulated_olt and onu to show how
to process incoming bulk flow table
- extended Tibit OLT and ONU code with remaining flow
directives they need to handle in the PON use-case
Change-Id: Id101e087cc79f4493805e3b4a051a10a4619bf53
diff --git a/cli/device.py b/cli/device.py
index 94e24e6..3ab4b0d 100644
--- a/cli/device.py
+++ b/cli/device.py
@@ -21,6 +21,7 @@
from cmd2 import Cmd
from simplejson import dumps
+from cli.table import print_pb_as_table, print_pb_list_as_table
from cli.utils import print_flows, pb2dict
from voltha.protos import third_party
@@ -47,8 +48,16 @@
def do_show(self, line):
"""Show detailed device information"""
- self.poutput(dumps(pb2dict(self.get_device(depth=-1)),
- indent=4, sort_keys=True))
+ print_pb_as_table('Device {}'.format(self.device_id),
+ self.get_device(depth=-1))
+
+ def do_ports(self, line):
+ """Show ports of device"""
+ device = self.get_device(depth=-1)
+ omit_fields = {
+ }
+ print_pb_list_as_table('Device ports:', device.ports,
+ omit_fields, self.poutput)
def do_flows(self, line):
"""Show flow table for device"""