On Wed, Feb 20, 2013 at 9:18 AM, Adrien Thebo <[email protected]> wrote:

> On Tue, Feb 19, 2013 at 11:10 PM, Andrew Parker <[email protected]>wrote:
>
>>
>> How about the provider just writes it out as a temp file when it needs
>> it? If it is static, should never be edited, and is needed for the provider
>> to execute correctly, then I can see just keeping it the code and writing
>> it out when needed. Also, I believe it was not a very large file, so it
>> won't bloat the code.
>>
>
> That's an approach that I hadn't considered. By having a heredoc in the
> code and then writing out something with Tempfile?
>

That is what I was thinking.

  Tempfile.open("libuser.conf") do |conf_file|
    conf_file.write(LIBUSER_CONF)
    # do things that need the file
  end

Looking over the docs for Tempfile, though, using #open might not be the
best thing since it doesn't unlink the file :(
I'm willing to bet there is something in puppet for handling this properly,
but I can't recall off the top of my head.


>
> --
> Adrien Thebo | Puppet Labs
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to