diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-08 13:12:31 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-09 05:17:57 -0800 |
commit | a0b87f1ddf849cc44a39645fb296bfe2d3a5b287 (patch) | |
tree | cc620dc8e685ba914a4f489a4f5ceb34c3992982 /tools/pyang_plugins/bgpyang2golang.py | |
parent | b0fbcc6b1b18d2c9fe67437fe6432914b67c5508 (diff) |
config: catch up with the latest openconfig
using commit 20b9cc544012201069e9d6a159ebab17f4172dfb
from github.com/openconfig/public
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'tools/pyang_plugins/bgpyang2golang.py')
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index ce64fce0..8acbfa02 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -448,7 +448,14 @@ def emit_typedef(ctx, module): else: print >> o, '// typedef for typedef %s:%s'\ % (prefix, type_name_org) - print >> o, 'type %s %s' % (type_name, t.arg) + + if not is_builtin_type(t): + m = ctx.golang_typedef_map + for k in t.arg.split(':'): + m = m[k] + print >> o, 'type %s %s' % (type_name, m.golang_name) + else: + print >> o, 'type %s %s' % (type_name, t.arg) print o.getvalue() |