pyang icon indicating copy to clipboard operation
pyang copied to clipboard

warning: imported module "X" not used when using sx:augment-structure

Open mrdeep1 opened this issue 4 years ago • 0 comments

With pyang 2.4.0, using the examples from RFC8791, warning: imported module "foo" not used is reported, even though foo is used in the sx:augment-structure.

$ more foo.yang 
  module foo {
     namespace "urn:ietf:params:xml:ns:yang:foo";
     prefix foo;
     import ietf-yang-structure-ext { prefix sx; }

     sx:structure foo-data {
       container foo-con { }
     }
  }
$ more bar.yang 
  module bar {
     namespace "urn:ietf:params:xml:ns:yang:bar";
     prefix bar;
     import ietf-yang-structure-ext { prefix sx; }
     import foo { prefix foo; }

     sx:augment-structure /foo:foo-data/foo:foo-con {
       leaf add-leaf1 { type int32; }
       leaf add-leaf2 { type string; }
     }
  }

and then run pyang

$ pyang --verbose bar.yang
..
# read bar.yang (CL)
# read ietf-yang-structure-ext.yang
# read foo.yang
bar.yang:5: warning: imported module "foo" not used

mrdeep1 avatar Dec 31 '20 12:12 mrdeep1