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