John,

The HI-14's requested behavior was not implemented as an afterthought. On the contrary. Since all facts have been available in the top scope since Puppet 3.5, there was simply no need for a specific handling of facts in Hiera and the approach taken was very deliberate. We knew that whatever we would put in place would be applicable for all variables in the scope. We also knew that since scope variables are not the only structured data out there, it would be somewhat congested to create solution that would work /only/ with scope variables but not with everything else. I think that would have been a really bad decision and as far as I can remember it was never brought up to discussion.

The current solution works with:

  %{scope('some.dotted.key')}

and

  %{hiera('some.dotted.key')}

and

  Hiera.lookup('some.dotted.key')

The interpolated hiera lookup is implicitly doing the last one so they need to come as a package. The way I see it, this is all about key interpretation (interpolation is a lookup) which might explain my line of thought when first answering your question.

All current behavior is retained with one exception; sites that make use of dotted keys in their own Hiera data today will break when they start using Hiera 2.0. I totally agree that this must be explicitly stated in the documentation since we apparently have had no restriction on this in the past. An example retrieving data from inside a structured fact would be a good addition too.

- thomas


On 2015-04-02 16:29, John Bollinger wrote:


On Wednesday, April 1, 2015 at 5:17:54 PM UTC-5, Thomas Hallgren wrote:

    John,

    We're seem to be talking past each other here. The description in HI-14 
mentions facts specifically and that too
    is available. I can declare this for instance:

    days_up: "%{scope('system_uptime.days')}"

    or simply:

    days_up: "%{system_uptime.days}"

    and it returns the 'days' item from the structured fact 'system_uptime'. IMO, 
that's "traversing structured data
    in interpolation tokens, with especial focus on structured fact values" but 
it's obviously not what you're looking
    for.



No, that's /exactly/ what I'm looking for. I am pleased and somewhat mollified to find that it's actually included. However, it seems not to be described anywhere in the docs -- neither in the release notes, nor in the section of the main (2.0.0) docs that deals with interpolation.

The flip side, however, is that the altered behavior of key interpretation, although attributed to HI-14 in the release notes and in the git log, /is no part of the feature actually requested in HI-14/, or in any of its duplicates. HI-14 has apparently been hijacked to implement an altogether different behavior than was requested and which acceptance of that ticket approved. All of the documentation around this ticket, other than the ticket itself, focuses on the key interpretation side. The bulk of the new tests focus on the key interpretation side. Even the initial answer to my question here focused on key interpretation. That HI-14's actual requested behavior was implemented, too, as an apparent afterthought, is little consolation.

With the key interpretation difference being a breaking change, the change management process has *failed* if that behavior change indeed was nowhere requested or approved. Therefore, as a matter of a disciplined approach to process, I would like to see the key interpretation part of the change backed out. Realistically, I have no expectation that that will actually happen. What needs to happen, though, is that the release notes be updated to document the key interpretation change as a breaking change, and that at least the main docs document the extended interpolation behavior (at all). Were I in PL's management, I would have additional items for that list.


John

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+unsubscr...@googlegroups.com <mailto:puppet-dev+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/673143a1-1d76-448d-a402-a518135748c0%40googlegroups.com <https://groups.google.com/d/msgid/puppet-dev/673143a1-1d76-448d-a402-a518135748c0%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/551D6129.6040805%40puppetlabs.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to