mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
530 stars 343 forks source link

Warning generated when must statement references an augmented node #768

Closed deastoe closed 2 years ago

deastoe commented 2 years ago

With the following example modelset:

module base {
    namespace "uri:base";
    prefix base;

    container root;
}
module foo {
    namespace "uri:foo";
    prefix foo;

    import base {
        prefix base;
    }

    grouping foo-grp {
        container foo {
            presence "foo enabled";
        }
    }

    uses foo-grp {
        refine foo {
            // /foo and /base:root/foo are mutually exclusive
            must "not(/base:root/foo:foo)";
        }
    }

    augment "/base:root" {
        uses foo-grp;
    }
}

The latest pyang generates an unexpected warning:

$ pyang foo.yang 
foo.yang:18: warning: node "foo::foo" is not found in "base::root"

Reverting f24051c872709ec5c057ea4783cb7faa94c8d56d removes the warning.

deastoe commented 2 years ago

Thanks for the quick fix @mbj4668!