On Wednesday, October 4, 2017 at 10:54:30 AM UTC-5, John Baird wrote:
>
> Problem:
>   So, currently as has been explained to me, doing a lookup with keys 
> containing "." chops the key at first "." because of scoping and namespace.
>


Well, that seems a bit of an odd characterization.  I think a better 
explanation would be that lookup() chops keys at the period character *because 
that character is not allowed in (simple) keys*.  It can be regarded as an 
operator when it appears in the key expression.  That has nothing to do 
with namespace or scope in Puppet's sense of those terms.  I realize that 
this limitation on keys is not well documented, and I sympathize with you 
about the confusion that it may have caused.  FWIW, essentially the same 
issue was previously raised against Hiera as HI-485 
<https://tickets.puppetlabs.com/browse/HI-485>.

 

>   This makes file-based lookups impossible (as far as I can tell).  I 
> would like to be able to use HTTP or other backends to serve files, which 
> by their very nature WILL contain file extensions.
>


Yes, it does make general filenames unsuitable for use as keys.  If you 
want to serve files as you describe then you'll need to perform some kind 
of translation between filenames and keys.  Do note, by the way, that in 
that case, the '.' character is not the only one you would need to be 
prepared to translate.

I don't quite follow why you want to do as you describe, but you should 
consider whether the best alternative would be to take an altogether 
different approach.  We could talk about how that might look if you fill us 
in on the bigger picture.

 

> Expectation:
>   While I understand that changing the very function of lookup to 
> accomodate this is out of scope, I would still think that providing a way 
> to tell lookup to NOT chomp or namespace the lookup would be appropriate?  
>
> Something like "lookup('/path/to/somefile.txt', scope=false)"... In this 
> manner, the user and more specifically, each lookup call can determine 
> whether or not to include the dotted key.
>
> Is this something we could push forward?  How would I go about doing that ?
>


The lookup() function already has a form that accepts an options hash.  In 
principle, that could be leveraged for what you want instead of adding a 
new argument.  If you want to pursue that then the Puppet Developers 
<https://groups.google.com/forum/#!forum/puppet-dev> group would be a 
better place to discuss it, and Puppet's issue tracker 
<https://tickets.puppetlabs.com/> would be the place to submit a formal 
feature request.  I'm inclined to doubt that such a request would be 
accepted, but I've been wrong before.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/245a24fe-df7e-44d3-a3ec-c2d42511a0c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to