Do not enforce augments in unsupported nodes
[yangtools.git] / parser / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / augment / AugmentInferenceAction.java
index 985b5e9855c8e03925af8daf12de3adc6d06a259..80f4e7e5db8f1d55fd28e45e1a208b74fa0bcc7e 100644 (file)
@@ -90,6 +90,11 @@ final class AugmentInferenceAction implements InferenceAction {
          * Do not fail, if it is an uses-augment to an unknown node.
          */
         if (YangStmtMapping.USES == augmentNode.coerceParentContext().publicDefinition()) {
+            if (!augmentNode.isSupportedToBuildEffective()) {
+                // We are not supported, hence the uses is not effective and we should bail
+                return;
+            }
+
             final SchemaNodeIdentifier augmentArg = augmentNode.getArgument();
             final Optional<StmtContext<?, ?, ?>> targetNode = SchemaTreeNamespace.findNode(
                 AbstractAugmentStatementSupport.getSearchRoot(augmentNode), augmentArg);