On Wed, Sep 29, 2010 at 9:22 PM, Jeff McCune <[email protected]> wrote:
> On Sat, Sep 25, 2010 at 2:45 PM, Nigel Kersten <[email protected]> 
> wrote:
>> What implications of introducing a new syntactical element are there?
>
> Yet another inconsistency and confusion for newbies.
>
> With that said, I think the benefits _far_ outweigh the drawbacks.
> Especially since it brings consistency to the behavior of file()
> template() and source.
>
>> Where else could we use this? On import statements?
>
> Any function that needs to read data from the file system on the master.
>
> I'm looking at you, extlookup() ...
>
> Today I wrote a function called getconf() which is little more than
>
> Puppet::Parser::Functions.newfunction(:getconf, :type => :rvalue) do |args|
>  Puppet.settings[args[0]]
> end
>
> The motivation was to store extlookup data inside of confdir which is
> usually under version control and at different file system paths for
> development, testing, and production.
>
> $confdir = getconf("confdir")
> $extlookup_datadir = "${confdir}/extdata"
>
>> import "foo.pp" already looks in the current working directory, but is
>> there any point trying to add this throughout the language so you can
>> do:
>>
>> # modules/foo/manifests/a/b/c/d/contrived.pp
>> import "~/clean.pp"
>>
>> and it resolves to modules/foo/manifests/clean.pp ?
>
> I think no matter what the path expansion logic should be generalized
> into some utility method so types, providers, functions, report
> processors, and whatever else we cook up can take advantage of this.
>
> A quick win could be to add an path_to() function to the language
> which should give us the desired behavior for free.
>
> import path_to("~/clean.pp")

Please update the bug with this so it doesn't fall through the tracks,
agreed on all counts.

http://projects.puppetlabs.com/issues/4885

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to