acidjunk / pyang

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

Traceback for YIN module with invalid key definition #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the attached YIN module, list key is declared with a wrong attribute name 
(instead of correct "value").
Running pyang on it leads to a traceback:

$ pyang attrname.yin 
Traceback (most recent call last):
  File "/Users/lhotka/bin/pyang", line 315, in <module>
    run()
  File "/Users/lhotka/bin/pyang", line 234, in run
    expect_failure_error=False)
  File "/Users/lhotka/lib/python/pyang/__init__.py", line 94, in add_module
    return self.add_parsed_module(module)
  File "/Users/lhotka/lib/python/pyang/__init__.py", line 122, in add_parsed_module
    statements.validate_module(self, module)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 91, in validate_module
    iterate(module, phase)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 80, in iterate
    iterate(s, phase)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 49, in iterate
    res = f(ctx, stmt)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 197, in <lambda>
    ('reference_1', 'list'):lambda ctx, s:v_reference_list(ctx, s),
  File "/Users/lhotka/lib/python/pyang/statements.py", line 1655, in v_reference_list
    v_key()
  File "/Users/lhotka/lib/python/pyang/statements.py", line 1555, in v_key
    for x in key.arg.split():
AttributeError: 'NoneType' object has no attribute 'split'

Original issue reported on code.google.com by lada.lho...@gmail.com on 31 May 2013 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mbj4...@gmail.com on 23 Oct 2013 at 1:33