Subject: [netmod] duplicate leaf names in augments

From: David Reid <[email-masked]>
Date: Fri, 14 Nov 2008 16:06:39 -0500

If I have 2 different augments in the same module, do the leaf identifiers
have to be unique? Below is an example, where ChannelNumber is used twice. 
I don't think that is legal, but I'm not sure what rule tells me it is not.

    module if {
        namespace "http://example.com/schema/interfaces"
        prefix "if";

        container interfaces {
            list ifEntry {
                key "ifIndex";

                leaf ifIndex { type uint32; }
                leaf ifDescr { type string; }
                leaf ifType { type iana:IfType; }
                leaf ifMtu { type int32; }
            }
        }

        augment "/if:interfaces/if:ifEntry" {
            when "if:ifType='ds0'";
            leaf ChannelNumber {
                 type ChannelNumber;
            }
        }

        augment "/if:interfaces/if:ifEntry" {
            when "if:ifDescr='xyz'";
            leaf ChannelNumber {
                 type ChannelNumber;
            }
        }
    }

-David Reid
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Andy Bierman <[email-masked]>
Date: Fri, 14 Nov 2008 16:44:04 -0800

> I don't think that is legal, but I'm not sure what rule tells me it is not.

good question.
It applies to any usage of thew 'when' statement, not just augment.
IMO, no -- otherwise you can end up with an invalid schema
based on the value of arbitrary leaf value.  All QName siblings
need to be unique, regardless of when and if-feature values.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 16 Nov 2008 09:53:24 -0600 (CST)

> I don't think that is legal, but I'm not sure what rule tells me it is not.

You're right that it is not supposed to be legal and also that some
text is missing.  I think we need a new rule in 6.2.1.

/martin