marvin-zhao / pyang

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

bogus warning: imported module not used #82

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With the three modules below, pyang issues an incorrect warning:

$ pyang a.yang b.yang c.yang 
b.yang:7: warning: imported module a not used

Module "a" must be imported in "b" because the 'path' statement refers to a 
node in "a".

If the 'import' statement is removed from "b", pyang (correctly) raises an 
error.

== a.yang:

module a {
  namespace "http://a";
  prefix a;

  container top {
    leaf a {
      type string;
    }
  }
}

== b.yang:

module b {
  namespace "http://b";
  prefix b;

  import a {
    prefix a;
  }
  grouping foo {
    leaf b {
      type leafref {
        path "../a:a";
      }
    }
  }
}

== c.yang:

module c {
  namespace "http://c";
  prefix c;

  import a {
    prefix a;
  }
  import b {
    prefix b;
  }

  augment "/a:top" {
    uses b:foo;
  }
}

Original issue reported on code.google.com by lada.lho...@gmail.com on 28 Feb 2013 at 10:22

GoogleCodeExporter commented 9 years ago
This one seems to be fixed.

Original comment by mbj4...@gmail.com on 14 Nov 2014 at 1:53