On Mon, Mar 22, 2010 at 1:50 PM, Luke Kanies <[email protected]> wrote:

> On Mar 22, 2010, at 12:22 PM, Dan Bode wrote:
>
>  I agree that this should be implemented. what hook can I use to implement
>> functionality that occurs after everything has been flushed?
>>
>>
> Basically just change the default target to a tmp file or something, and
> modify flush to write the file, check it, and copy it over if it passes.
>

The following code tries to do that:

  def self.flush_target(target)
    Puppet.info("We are flushing #{target}")
    #  a little pre-flush hot visudo action
    #puts File.read(target)
    visudo("-cf", target) unless (File.zero?(target) or !File.exists?(target))
    super(target)
  end

I just realized that this checks the previous state of the existing file and
not the current line. I can fix this.



> I think. :)
>
> --
> Due to circumstances beyond your control, you are master of your fate
> and captain of your soul.
>
> ---------------------------------------------------------------------
> Luke Kanies  -|-   http://reductivelabs.com   -|-   +1(615)594-8199
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<puppet-dev%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to