I like the idea but have a nit-pick:

    mode = self.should(:mode) # might be nil
>     umask = mode ? 000 : 022
> +    mode_int = mode ? Puppet::Util::Octal.integerForOctal(mode) : nil
>

Why not just:

    mode_int = mode && mode.to_i(8)

or even do it inline:

-    content_checksum = Puppet::Util.withumask(umask) { File.open(path, 'w',
> mode) { |f| write_content(f) } }
> +    content_checksum = Puppet::Util.withumask(umask) { File.open(path,
> 'w', mode_int ) { |f| write_content(f) } }
>

+    content_checksum = Puppet::Util.withumask(umask) { File.open(path, 'w',
mode && mode.to_i(8) ) { |f| write_content(f) } }

and likewise in subsequent places.

And here:


> +        Puppet::Util::Octal.octalForInteger(
> Puppet::Util::Octal.integerForOctal( should ) )
>

    should.to_i(8).to_s(8)

but I'm not seeing what this accomplishes (stripping leading 0s?)

-- Markus
-----------------------------------------------------------
The power of accurate observation is
commonly called cynicism by those
who have not got it.  ~George Bernard Shaw
------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to