mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
537 stars 344 forks source link

deviation statement for type leafref #687

Open mdoshi-com opened 4 years ago

mdoshi-com commented 4 years ago

Hi, I am trying to use deviation to change type of a leafref attribute. But it doesnt seem to be working. Can you please help.

  1. yang using deviation (o-ran-agg-uplane-conf.yang)
deviation "/agg:aggregated-o-ru/agg:aggregation/uplane-conf-model/user-plane-configuration/tx-array-carriers/rw-duplex-scheme" {
        deviate replace {
                type string;
   }
}
  1. yang where leaf is defined (o-ran-uplane-conf.yang)
 leaf rw-duplex-scheme {
      type leafref {
        path "/user-plane-configuration/tx-array-carriers[name=current()/../name]" + "/duplex-scheme";
        require-instance false;
      }
      description
        "Config true type of duplex scheme.";
    }
  1. error displayed:
$pyang --format=tree --output=sample.tree *.yang

o-ran-uplane-conf.yang:610: error: "o-ran-agg-uplane-conf:user-plane-configuration" in the path for rw-duplex-scheme at o-ran-agg-uplane-conf.yang:87 (at o-ran-uplane-conf.yang:608) is not found
  1. pyang version
    [root@localhost meghna]# pyang --version
    pyang 2.3.2

Yang files attached in zip.

yang-deviate.zip

Regards, Meghna

fredgan commented 4 years ago

Hi Meghna, I run the command: pyang --format=tree o-ran-uplane-conf.yang

shows the errors:

o-ran-uplane-conf.yang:6: error: module "o-ran-processing-element" not found in search path
o-ran-uplane-conf.yang:14: error: module "o-ran-module-cap" not found in search path
o-ran-uplane-conf.yang:20: error: module "o-ran-compression-factors" not found in search path

Would you mind ataching the imported Yang files?

By the way , I didn't see any other errors like you.

mdoshi-com commented 4 years ago

Hi, Please find attached the full set of yangs. Please try once now with this.

Regards, Meghna

ru-deviate-yang.zip

mdoshi-com commented 4 years ago

Hi, Were you able to try with the full set of yangs.

Regards, Meghna

mdoshi-com commented 4 years ago

Hi, Anything you could try with the full of set yang files given above.

Regards, Meghna

fredgan commented 4 years ago

@mdoshi-com Hi Meghna, apologize for long time. I will try.

mdoshi-com commented 4 years ago

Hi, Sure no problem.

Thanks, Meghna