Subject: [netmod] implemented vs imported modules - checking XPath expressions

From: Radek Krejčí <[email-masked]>
Date: Tue, 8 Nov 2016 13:51:46 +0100

Hi,
I have the following 3 modules and only the module c is initially
implemented. Because the module a is targeted in c's augment, a must be
also implemented. Since the b is not targeted in any augment nor
leafref, it need not be implemented.

In such a case (a, c are implemented; b is imported), is the module c
valid? It refers leaf b in the must expression, but the target leaf does
not exists (module b is not implemented, so it does not augments data in
module a). Is there any way how the module c could specify that the
imported module b must be also implemented?

module a {
  ...
  container a {
    leaf a {
      type string;
    }
  }
}

module b {
  ...
  import a {
    prefix a;
  }

  augment /a:a {
    leaf b {
      type string;
    }
  }
}

module c {
  ...
  import a {
    prefix a;
  }
  import b {
    prefix b;
  }

  augment /a:a {
    leaf c {
      type string;
      must "/a:a/b:b";
    }
  }
}

Regards,
Radek Krejci

---

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 8 Nov 2016 14:48:32 +0100

Hi Radek,

> On 8 Nov 2016, at 13:51, Radek Krejčí <[email-masked]> wrote:
> 
> Hi,

My take is that module c is valid, but leaf c cannot be present in the data because its "must" expression is always false. A clever tool might issue a warning.

> imported module b must be also implemented?

Unfortunately, no. Andy's expired draft-bierman-netmod-yang-package-00 aimed at this.

Lada

> 
> module a {
>  ...
>  container a {
>    leaf a {
>      type string;
>    }
>  }
> }
> 
> module b {
>  ...
>  import a {
>    prefix a;
>  }
> 
>  augment /a:a {
>    leaf b {
>      type string;
>    }
>  }
> }
> 
> module c {
>  ...
>  import a {
>    prefix a;
>  }
>  import b {
>    prefix b;
>  }
> 
>  augment /a:a {
>    leaf c {
>      type string;
>      must "/a:a/b:b";
>    }
>  }
> }
> 
> Regards,
> Radek Krejci
> 
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C