diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-03-02 11:51:40 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-03-03 11:44:26 +0900 |
commit | 39473d297fbbd7963054e5525f78b5abce63b088 (patch) | |
tree | d16f1fd9eee09723ef50383ab1146cf92d0b14e0 /tools/pyang_plugins | |
parent | 3bb006e8a55ebc97f4036c75427ec5fdf770bab3 (diff) |
pyang_plugin: remove unused codes
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'tools/pyang_plugins')
-rw-r--r-- | tools/pyang_plugins/bgpyang2golang.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/pyang_plugins/bgpyang2golang.py b/tools/pyang_plugins/bgpyang2golang.py index f7bce316..e71e3f88 100644 --- a/tools/pyang_plugins/bgpyang2golang.py +++ b/tools/pyang_plugins/bgpyang2golang.py @@ -198,7 +198,6 @@ def visit_children(ctx, module, children, prefix=''): type_name = t.arg if t is not None else None if is_list(c) or is_container(c): c.golang_name = convert_to_golang(c.arg) - c.module_name = module.i_prefix ctx.golang_struct_def.append(c) ctx.golang_struct_names[c.arg] = c if hasattr(c, 'i_children'): @@ -215,7 +214,6 @@ def visit_typedef(ctx, module): if stmts.golang_name == 'PeerType': stmts.golang_name = 'PeerTypeDef' child_map[name] = stmts - ctx.golang_typedef_map[prefix] = child_map @@ -225,7 +223,7 @@ def visit_identity(ctx, module): for stmts in module.substmts: if stmts.keyword == 'identity': name = stmts.arg - stmts.golang_name = 'Id' + convert_to_golang(name) + stmts.golang_name = convert_to_golang(name) child_map[name] = stmts ctx.golang_identity_map[prefix] = child_map @@ -311,12 +309,7 @@ def emit_identity(ctx, module): o = StringIO.StringIO() print >> o, '// typedef for identity %s:%s' % (prefix, type_name_org) - - def_type_name = 'struct' - if prefix+':'+type_name_org in _use_interface: - def_type_name = 'interface' - - print >> o, 'type %s %s {' % (type_name, def_type_name) + print >> o, 'type %s struct {' % (type_name) if base is not None: base_obj = lookup_identity(ctx, prefix, base.arg) print >> o, ' // base_type -> %s' % (base.arg) @@ -379,10 +372,6 @@ _type_builtin = ["union", "uint64", ] -_use_interface = [ - 'bgp-mp:afi-safi-type', - ] - def generate_header(ctx): print _COPYRIGHT_NOTICE |