Zsolt Haraszti | dafefe1 | 2016-11-14 21:29:58 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
2 | """ | ||||
3 | Read adapter data while decoding ext1 custom fields. | ||||
4 | """ | ||||
5 | import sys | ||||
6 | from json import dumps | ||||
7 | |||||
8 | from common.utils.json_format import MessageToDict | ||||
9 | from voltha.protos import adapter_pb2 | ||||
10 | |||||
11 | adapter = adapter_pb2.Adapter() | ||||
12 | binary = sys.stdin.read() | ||||
13 | adapter.ParseFromString(binary) | ||||
14 | |||||
15 | print dumps(MessageToDict(adapter, strict_any_handling=False)) | ||||
16 |