corenova / yang-js

YANG parser and composer
Apache License 2.0
56 stars 18 forks source link

bug in node identifier of uses augment? #55

Closed vcshox closed 7 years ago

vcshox commented 7 years ago

yang-module:

module uses-aug {

  grouping foo-grp {
    container cont-to-be-aug {

    }
  }
  uses foo-grp {
    augment "./cont-to-be-aug" {
      leaf leaf-a {
        type string;
      }
    }
  }
}

After the module is loaded, I loop over every element in the yang instance, no additional node is augmented.

After checking the RFC, ./cont-to-be-aug does not seem to be a formal node identifier. Maybe an error message is needed?

Even I set the value as a "./123"(a non-existing node), the situation is the same.

sekur commented 7 years ago

Yes, ./xxx is not a valid path identifier. We can add a simple validation logic to augment extension's resolve function to make sure it's compliant. Do you want to give it a try?

vcshox commented 7 years ago

ok, I will

sekur commented 7 years ago

@vcshox - thanks for your PR #56!