marvin-zhao / pyang

Automatically exported from code.google.com/p/pyang
0 stars 0 forks source link

module.i_prefixes bug (only with DSDL plugin) #73

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you try to generate DSDL from the "prefixes" module which I provide in the 
attachments it will break the plug-in. The modules which I provide are just 
dummies based on the quagga module which we got from tailf (Martin probably 
knows it). 

Anyways the main module (prefixes) specifies a submodule (prefixes-common) 
which imports another module (sample-extensions) and uses an extension from it. 
This extension breaks the plug-in in function dsdl.handle_extension(self, stmt, 
p_elem) because of the following call:

(modname,rev)=self.module.i_prefixes[prf]

since i_prefixes does not contain the prefix specified for the extension.

I think this is a bug in pyang not in DSDL plugin. i_prefixes of the main 
module does not appear to contain prefixes which are used within submodules yet 
it "inherits" all content from them including the offending extension. This 
means that the main module may contain extensions for which a binding in 
i_prefixes does not exist. I'm not entirely sure who's at fault here though.

Original issue reported on code.google.com by jernej.t...@gmail.com on 19 Apr 2012 at 2:14

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mbj4...@gmail.com on 19 Apr 2012 at 2:36

GoogleCodeExporter commented 9 years ago

Original comment by lada.lho...@gmail.com on 20 Apr 2012 at 9:16

GoogleCodeExporter commented 9 years ago
It was a bug in the DSDL plugin.

Original comment by lada.lho...@gmail.com on 25 Apr 2012 at 10:59