Trevor Vaughan
2010-Jul-12 15:46 UTC
[Puppet Users] Issue with scope.function_ in a template.
All,
I''m wondering if anyone knows how to force the scope object to pick up
custom functions that have not yet been utilized.
If you run a simple test with a custom function that you don''t use
anywhere but in a template, you should see the template hang and/or
fail.
If you use the function elsewhere in your manifest, the template will
function properly.
You can see this in action by outputting
scope.public_methods.sort.join("\n") in an erb file and searching for
your custom function name.
Thanks,
Trevor
--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com
-- This account not approved for unencrypted proprietary information --
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.
Trevor Vaughan
2010-Jul-12 21:18 UTC
[Puppet Users] Re: Issue with scope.function_ in a template.
I''m replying to myself since I have found a completely hack-ish
workaround to this issue, but still no "real" solution.
It turns out that the function in question just has to be noted in the
manifest *at all*.
So, you can do something like the following and then use it in your template:
if false {
myfunction("stuff")
}
Hopefully, someone will post back something far more elegant.
Thanks,
Trevor
On 7/12/10, Trevor Vaughan <tvaughan@onyxpoint.com>
wrote:> All,
>
> I''m wondering if anyone knows how to force the scope object to
pick up
> custom functions that have not yet been utilized.
>
> If you run a simple test with a custom function that you don''t use
> anywhere but in a template, you should see the template hang and/or
> fail.
>
> If you use the function elsewhere in your manifest, the template will
> function properly.
>
> You can see this in action by outputting
> scope.public_methods.sort.join("\n") in an erb file and searching
for
> your custom function name.
>
> Thanks,
>
> Trevor
>
>
> --
> Trevor Vaughan
> Vice President, Onyx Point, Inc
> (410) 541-6699
> tvaughan@onyxpoint.com
>
> -- This account not approved for unencrypted proprietary information --
>
--
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
tvaughan@onyxpoint.com
-- This account not approved for unencrypted proprietary information --
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.