blob: b9316a1ea4f3f236f55d548c2d58cd2dc48a12c7 [file] [log] [blame]
Zsolt Harasztidafefe12016-11-14 21:29:58 -08001#!/usr/bin/env python
2"""
3Write adapter data without any custom fields
4"""
5import sys
6
7import ext2_pb2
8from voltha.protos import adapter_pb2
9from google.protobuf import any_pb2
10
11
12def custom_config():
13 any = any_pb2.Any()
14 any.Pack(ext2_pb2.AdapterConfig(
15 conf1=1,
16 conf2=42,
17 conf3=0,
18 conf4=11111111111,
19 conf5=11231231,
20 things = ['foo', 'bar', 'baz', 'zoo']
21 ))
22 return any
23
24
25def custom_description():
26 any = any_pb2.Any()
27 any.Pack(ext2_pb2.AdapterDescription(
28 foo='hulu',
29 arg1=42,
30 arg2=42,
31 arg3=42,
32 arg4=42,
33 arg5=42
34 ))
35 return any
36
37
38adapter = adapter_pb2.Adapter(
39 id='42',
40 config=adapter_pb2.AdapterConfig(
41 additional_config=custom_config()
42 ),
43 additional_description=custom_description()
44)
45
46sys.stdout.write(adapter.SerializeToString())
47