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

Circular import is sometimes undetected #46

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments
Closed

Circular import is sometimes undetected #46

GoogleCodeExporter opened this issue Mar 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Circular import of modules is sometimes not detected. The two modules below are 
completely symmetrical but circular dependency is only reported for prefclashx:

module prefclash {
  namespace "http://prefclash";
  prefix a;
  import prefclashx {
    prefix a1;
  }
  leaf a {
    must "/a1:a < .";
    type uint8;
  }
}
$ cat prefclashx.yang 
module prefclashx {
  namespace "http://prefclashx";
  prefix a;
  import prefclash {
    prefix a1;
  }
  leaf a {
    must "/a1:a > .";
    type uint8;
  }
}
$ pyang prefclash.yang 
$ pyang prefclashx.yang 
prefclash.yin:7: error: circular dependency for module "prefclashx"

Original issue reported on code.google.com by lada.lho...@gmail.com on 24 Jun 2010 at 7:09

@GoogleCodeExporter
Copy link
Author

This is actually a side effect of the fact that YIN versions of the same 
modules were present in the same directory, but in prefclashx.yin the 'import' 
statement was removed. The 'import' statement from a YANG file actually imports 
YIN file.

I think we need to specify exactly the search order, including the YIN and YANG 
versions of the same module.

It might also make sense to provide just module names at the command line 
instead of file names:

$ pyang foo

Original comment by lada.lho...@gmail.com on 24 Jun 2010 at 7:27

@GoogleCodeExporter
Copy link
Author

I think it is ok if it is unspecified which file is loaded if there is both a 
yin and yang file in the same directory.

Original comment by mbj4...@gmail.com on 6 Oct 2010 at 10:37

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant