…
}
In this case, I only imported a.yang to b.yang. But I didn’t do anything else. Will a “a-config” instance be created inside module b ? (my understanding is no)
In other way, If a is a submodule of b and inside b,
include a;
Will a-config instance be created ? (my understanding is yes)
Yes, your understanding is correct. I think this is clear from the definitions of the two statements (RFC 7950):
The “import” statement makes definitions from one module available inside another module or submodule. (7.1.5)
The “include” statement is used to make content from a submodule available to that submodule’s parent module. (7.1.6)
So import makes the modules definitions available for references from the importing module, include “incorporates the contents of the submodule into the node hierarchy of the module” (as is written further in the RFC).