Subject: [netmod] intra-module augments

From: David Reid <[email-masked]>
Date: Wed, 18 Mar 2009 13:48:54 -0400

>From a discussion on a different thread, Lada said:

> I agree, except that such intra-module augments are not allowed anymore.
> 
> Sec. 7.15:
> The "augment" statement allows a module or submodule to add to the
> schema tree defined in another module or submodule, and to add to the
> nodes from a grouping in a "uses" statement.

Why are intra-module augments not allowed?

If a submodule can augment a list in the module it belongs to, I don't see
any reason an augment statement in a module can't augment a list in the
same module.

-David Reid

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 18 Mar 2009 20:48:53 +0100 (CET)

> Why are intra-module augments not allowed?

"Whoops".  This was not the intention.  It seems this text has been
there from -00.  Compare with the text in 4.2.8:

  4.2.8. Extending Data Models (augment)

     YANG allows a module to insert additional nodes into data models,
     including both the current module (and its submodules) or an external
     module.

7.15 should use the same words.

> any reason an augment statement in a module can't augment a list in the

Exactly.

Thanks for spotting this!

/martin

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 18 Mar 2009 21:24:41 +0100

> Why are intra-module augments not allowed?

I think they are not needed, you can add the nodes directly to the place
where they belong, if you are already changing the text of the same
module.

> any reason an augment statement in a module can't augment a list in the

I think an augment in a submodule is a way to add nodes to non-root
locations of the main module.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 18 Mar 2009 21:28:07 +0100

> 7.15 should use the same words.

I'd actually prefer the 7.15 version. :-)

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: David Reid <[email-masked]>
Date: Wed, 18 Mar 2009 16:28:10 -0400

> where they belong, if you are already changing the text of the same

The only reason I care is for mapping SNMP MIBs which sometimes do this. 
Otherwise, I agree with you that it is not necessary when writing a new
yang module. But I don't see any reason to forbid it.

-David Reid

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 18 Mar 2009 21:32:46 +0100 (CET)

> yang module. But I don't see any reason to forbid it.

I agree.  Since it is technically the same as doing the augmentation
from a submodule, it would be a classic CLR to not allow it from the
main module.

/martin