Re: [netmod] removing a node from a grouping
On Mon, 2018-07-16 at 09:33 -0400, Robert Wilton wrote: > Hi Lada, > > On 16/07/2018 08:35, Ladislav Lhotka wrote: > > Robert Wilton writes: > > > > > Hi Kent, > > > > > > I'm not sure that sec 7.13.2 of 7950 allows refine to add a when > > > statement, although an equivalent solution would be refine it with an > > > if-feature statement for a feature that is never enabled. > > > > Neither "when" nor "if-feature" is permitted as a substatement of > > "refine". > My reading of 7950, is that you are allowed to refine a node to add an "if- > feature". > > RFC 7950, section 7.13.2: > > The following refinements can be done: > > > >o A leaf, leaf-list, list, container, choice, case, anydata, or > anyxml node may get additional "if-feature" expressions. Oh yes, you are right, I looked into the ABNF and failed to see *if-feature-stmt Sorry, Lada > > Thanks, > Rob > > > Lada > > > > > Ideally, I think that the groupings would be split up, so that they > > > build on each other. > > > > > >grouping "foo" { > > > container-or-leaf "foo" { ... } > > >} > > > > > >grouping "bar-etc" { > > > container-or-leaf "bar" { ... } > > > ... // the "etc" ;) > > >} > > > > > >grouping "foo-bar-etc" { > > > grouping "foo"; > > > grouping "bar-etc"; > > >} > > > > > > Thanks, > > > Rob > > > > > > On 11/07/2018 18:30, Kent Watsen wrote: > > > > Say there is: > > > > > > > >grouping "foo-bar-etc" { > > > > container-or-leaf "foo" { ... } > > > > container-or-leaf "bar" { ... } > > > > ... // the "etc" ;) > > > >} > > > > > > > > And the goal is to use the grouping sans the "foo" node. > > > > Can a "when" statement that always evaluates to "false" > > > > do it? > > > > > > > >grouping "bar-etc" { > > > > uses "foo-bar-etc" { > > > >refine "listen" { > > > > when "false()"; > > > >} > > > > } > > > >} > > > > > > > > Any better ideas? > > > > > > > > Thanks, > > > > Kent > > > > > > > > > > > > > > > > ___ > > > > netmod mailing list > > > > netmod@ietf.org > > > > https://www.ietf.org/mailman/listinfo/netmod > > > > .. > > > > > > > > > > ___ > > > netmod mailing list > > > netmod@ietf.org > > > https://www.ietf.org/mailman/listinfo/netmod > > ___ > netmod mailing list > netmod@ietf.org > https://www.ietf.org/mailman/listinfo/netmod -- Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67 ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
So it seems that grouping "bar-etc" { uses "foo-bar-etc" { refine "foo" { if-feature never-supported-feature ; } } } would work. It seems rather similar to a deviation. regards Balazs On 7/16/2018 9:33 AM, Robert Wilton wrote: Hi Lada, On 16/07/2018 08:35, Ladislav Lhotka wrote: Robert Wilton writes: Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Neither "when" nor "if-feature" is permitted as a substatement of "refine". My reading of 7950, is that you are allowed to refine a node to add an "if-feature". RFC 7950, section 7.13.2: The following refinements can be done: . o A leaf, leaf-list, list, container, choice, case, anydata, or anyxml node may get additional "if-feature" expressions. Thanks, Rob Lada Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: Say there is: grouping "foo-bar-etc" { container-or-leaf "foo" { ... } container-or-leaf "bar" { ... } ... // the "etc" ;) } And the goal is to use the grouping sans the "foo" node. Can a "when" statement that always evaluates to "false" do it? grouping "bar-etc" { uses "foo-bar-etc" { refine "listen" { when "false()"; } } } Any better ideas? Thanks, Kent ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod ... ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod -- Balazs Lengyel Ericsson Hungary Ltd. Senior Specialist Mobile: +36-70-330-7909 email: balazs.leng...@ericsson.com ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
Hi Lada, On 16/07/2018 08:35, Ladislav Lhotka wrote: Robert Wilton writes: Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Neither "when" nor "if-feature" is permitted as a substatement of "refine". My reading of 7950, is that you are allowed to refine a node to add an "if-feature". RFC 7950, section 7.13.2: The following refinements can be done: o A leaf, leaf-list, list, container, choice, case, anydata, or anyxml node may get additional "if-feature" expressions. Thanks, Rob Lada Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: Say there is: grouping "foo-bar-etc" { container-or-leaf "foo" { ... } container-or-leaf "bar" { ... } ... // the "etc" ;) } And the goal is to use the grouping sans the "foo" node. Can a "when" statement that always evaluates to "false" do it? grouping "bar-etc" { uses "foo-bar-etc" { refine "listen" { when "false()"; } } } Any better ideas? Thanks, Kent ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod . ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
Robert Wilton writes: > Hi Kent, > > I'm not sure that sec 7.13.2 of 7950 allows refine to add a when > statement, although an equivalent solution would be refine it with an > if-feature statement for a feature that is never enabled. Neither "when" nor "if-feature" is permitted as a substatement of "refine". Lada > > Ideally, I think that the groupings would be split up, so that they > build on each other. > >grouping "foo" { > container-or-leaf "foo" { ... } >} > >grouping "bar-etc" { > container-or-leaf "bar" { ... } > ... // the "etc" ;) >} > >grouping "foo-bar-etc" { > grouping "foo"; > grouping "bar-etc"; > } > > Thanks, > Rob > > On 11/07/2018 18:30, Kent Watsen wrote: >> Say there is: >> >>grouping "foo-bar-etc" { >> container-or-leaf "foo" { ... } >> container-or-leaf "bar" { ... } >> ... // the "etc" ;) >>} >> >> And the goal is to use the grouping sans the "foo" node. >> Can a "when" statement that always evaluates to "false" >> do it? >> >>grouping "bar-etc" { >> uses "foo-bar-etc" { >>refine "listen" { >> when "false()"; >>} >> } >>} >> >> Any better ideas? >> >> Thanks, >> Kent >> >> >> >> ___ >> netmod mailing list >> netmod@ietf.org >> https://www.ietf.org/mailman/listinfo/netmod >> . >> > > ___ > netmod mailing list > netmod@ietf.org > https://www.ietf.org/mailman/listinfo/netmod -- Ladislav Lhotka Head, CZ.NIC Labs PGP Key ID: 0xB8F92B08A9F76C67 ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
On 2018-07-15 13:11, Robert Wilton wrote: Hi Kent, I don't think that this is a valid use of augment - I thought that augment can only add news data nodes, not add extra sub statements to existing ones. Well, it is valid (though not if "foo" is a leaf), but you are right, and it doesn't do what Kent expects. The 'when' statement, as always, "makes its parent data definition statement conditional". I.e. it applies to the 'augment' statement, not the 'foo' statement, and thus with an always-false 'when', no 'augment' will happen. --Per Also, YANG allows grouping to be changed so that it is constructed from sub groupings, at long as the original grouping name is preserved and is only updated in a backwards compatible way. But as you say, this can still lead to unnatural groupings. I still think that groupings are probably being overused. Perhaps Andy's clone statement might be a better alternative in some cases (https://github.com/netmod-wg/yang-next/issues/31). Thanks, Rob On 14/07/2018 18:46, Kent Watsen wrote: Hi Rob, Right you are, "refine" doesn't have a "when" substatement, but "augment" does. grouping "bar-etc" { uses "foo-bar-etc" { augment "foo" { when "false()"; } } } The problem with splitting up groupings is that 1) it needs to be done beforehand and 2) it may produce "unnatural" groupings that wouldn't be there otherwise. Kent = original message = Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: Say there is: grouping "foo-bar-etc" { container-or-leaf "foo" { ... } container-or-leaf "bar" { ... } ... // the "etc" ;) } And the goal is to use the grouping sans the "foo" node. Can a "when" statement that always evaluates to "false" do it? grouping "bar-etc" { uses "foo-bar-etc" { refine "foo" { when "false()"; } } } Any better ideas? Thanks, Kent ___ netmod mailing list netmod@ietf.org https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwIDaQ&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=n8AUR8gtF330d96dqckvx53hCdyUm5tsTzJsm6DU83U&s=hD50p0RzLVzzTnQ62nxgs256wFf7UmIczTJMf9ym_n8&e= . ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
Hi Kent, I don't think that this is a valid use of augment - I thought that augment can only add news data nodes, not add extra sub statements to existing ones. Also, YANG allows grouping to be changed so that it is constructed from sub groupings, at long as the original grouping name is preserved and is only updated in a backwards compatible way. But as you say, this can still lead to unnatural groupings. I still think that groupings are probably being overused. Perhaps Andy's clone statement might be a better alternative in some cases (https://github.com/netmod-wg/yang-next/issues/31). Thanks, Rob On 14/07/2018 18:46, Kent Watsen wrote: Hi Rob, Right you are, "refine" doesn't have a "when" substatement, but "augment" does. grouping "bar-etc" { uses "foo-bar-etc" { augment "foo" { when "false()"; } } } The problem with splitting up groupings is that 1) it needs to be done beforehand and 2) it may produce "unnatural" groupings that wouldn't be there otherwise. Kent = original message = Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: Say there is: grouping "foo-bar-etc" { container-or-leaf "foo" { ... } container-or-leaf "bar" { ... } ... // the "etc" ;) } And the goal is to use the grouping sans the "foo" node. Can a "when" statement that always evaluates to "false" do it? grouping "bar-etc" { uses "foo-bar-etc" { refine "foo" { when "false()"; } } } Any better ideas? Thanks, Kent ___ netmod mailing list netmod@ietf.org https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwIDaQ&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=n8AUR8gtF330d96dqckvx53hCdyUm5tsTzJsm6DU83U&s=hD50p0RzLVzzTnQ62nxgs256wFf7UmIczTJMf9ym_n8&e= . ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
Hi Rob, Right you are, "refine" doesn't have a "when" substatement, but "augment" does. grouping "bar-etc" { uses "foo-bar-etc" { augment "foo" { when "false()"; } } } The problem with splitting up groupings is that 1) it needs to be done beforehand and 2) it may produce "unnatural" groupings that wouldn't be there otherwise. Kent = original message = Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: > Say there is: > >grouping "foo-bar-etc" { > container-or-leaf "foo" { ... } > container-or-leaf "bar" { ... } > ... // the "etc" ;) >} > > And the goal is to use the grouping sans the "foo" node. > Can a "when" statement that always evaluates to "false" > do it? > >grouping "bar-etc" { > uses "foo-bar-etc" { >refine "foo" { > when "false()"; >} > } >} > > Any better ideas? > > Thanks, > Kent > > > > ___ > netmod mailing list > netmod@ietf.org > https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwIDaQ&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=n8AUR8gtF330d96dqckvx53hCdyUm5tsTzJsm6DU83U&s=hD50p0RzLVzzTnQ62nxgs256wFf7UmIczTJMf9ym_n8&e= > . > ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod
Re: [netmod] removing a node from a grouping
Hi Kent, I'm not sure that sec 7.13.2 of 7950 allows refine to add a when statement, although an equivalent solution would be refine it with an if-feature statement for a feature that is never enabled. Ideally, I think that the groupings would be split up, so that they build on each other. grouping "foo" { container-or-leaf "foo" { ... } } grouping "bar-etc" { container-or-leaf "bar" { ... } ... // the "etc" ;) } grouping "foo-bar-etc" { grouping "foo"; grouping "bar-etc"; } Thanks, Rob On 11/07/2018 18:30, Kent Watsen wrote: Say there is: grouping "foo-bar-etc" { container-or-leaf "foo" { ... } container-or-leaf "bar" { ... } ... // the "etc" ;) } And the goal is to use the grouping sans the "foo" node. Can a "when" statement that always evaluates to "false" do it? grouping "bar-etc" { uses "foo-bar-etc" { refine "listen" { when "false()"; } } } Any better ideas? Thanks, Kent ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod . ___ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod