Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested augment from submodule doesn't work. #206

Closed
llhotka opened this issue Feb 29, 2016 · 0 comments
Closed

Nested augment from submodule doesn't work. #206

llhotka opened this issue Feb 29, 2016 · 0 comments

Comments

@llhotka
Copy link
Collaborator

llhotka commented Feb 29, 2016

The following modules lead to KeyError. They

modules.zip

should IMO work.

$ cat main.yang 
module main {
  namespace "http://example.com/main";
  prefix m;

  container top;
}
$ cat test.yang 
module test {

  namespace "http://example.com/test";

  prefix "t";

  import main {
    prefix "m";
  }

  include subtest;

  augment "/m:top" {
    container cnt {
      presence "yes";
    }
  }
}
$ cat subtest.yang 
submodule subtest {

  belongs-to test {
    prefix "t";
  }

  import main {
    prefix "m";
  }

  augment "/m:top/t:cnt" {
    leaf foo {
      mandatory "true";
      type string;
    }
  }
}
$ pyang main.yang test.yang 
Traceback (most recent call last):
  File "/Users/lhotka/bin/pyang", line 425, in <module>
    run()
  File "/Users/lhotka/bin/pyang", line 291, in run
    expect_failure_error=False)
  File "/Users/lhotka/lib/python/pyang/__init__.py", line 100, 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 95, in validate_module
    iterate(module, phase)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 87, in iterate
    iterate(s, phase)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 52, in iterate
    res = f(ctx, stmt)
  File "/Users/lhotka/lib/python/pyang/statements.py", line 198, in <lambda>
    ('expand_2', 'augment'):lambda ctx, s: v_expand_2_augment(ctx, s),
  File "/Users/lhotka/lib/python/pyang/statements.py", line 1529, in v_expand_2_augment
    del stmt.i_module.i_undefined_augment_nodes[ch]
KeyError: <pyang.statements.Statement object at 0x10261b950>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant