diff options
author | Luke Kanies <luke@madstop.com> | 2009-04-21 02:33:49 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-04-22 03:23:00 +1000 |
commit | c1be88742d143128ed8240316b6269b585c5084e (patch) | |
tree | f3021dcd05497a00a4ad1fdb49fcf6f2591bac29 /spec/unit | |
parent | e2201d6e52b85ddbeaf107a41eb627994eb6973c (diff) | |
download | puppet-c1be88742d143128ed8240316b6269b585c5084e.tar.gz puppet-c1be88742d143128ed8240316b6269b585c5084e.tar.xz puppet-c1be88742d143128ed8240316b6269b585c5084e.zip |
Fixing #2171 - All certificate files are written with default perms
We were already writing all specific files with
appropriate permissions; this change makes all of
the files that are part of a group (which largely
means files saved by puppetmasterd and puppetca)
are also written using the correct permissions.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/indirector/key/file.rb | 4 | ||||
-rwxr-xr-x | spec/unit/indirector/ssl_file.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/indirector/key/file.rb b/spec/unit/indirector/key/file.rb index 8a1cb04bd..f365bfd60 100755 --- a/spec/unit/indirector/key/file.rb +++ b/spec/unit/indirector/key/file.rb @@ -70,11 +70,11 @@ describe Puppet::SSL::Key::File do end it "should save the public key when saving the private key" do - File.stubs(:open).with(@private_key_path, "w") + Puppet.settings.stubs(:writesub) fh = mock 'filehandle' - File.expects(:open).with(@public_key_path, "w").yields fh + Puppet.settings.expects(:writesub).with(:publickeydir, @public_key_path).yields fh @public_key.expects(:to_pem).returns "my pem" fh.expects(:print).with "my pem" diff --git a/spec/unit/indirector/ssl_file.rb b/spec/unit/indirector/ssl_file.rb index 89f682f38..559e2f98d 100755 --- a/spec/unit/indirector/ssl_file.rb +++ b/spec/unit/indirector/ssl_file.rb @@ -173,11 +173,11 @@ describe Puppet::Indirector::SslFile do end describe "and a directory setting is set" do - it "should open the file in write mode" do + it "should use the Settings class to write the file" do @searcher.class.store_in @setting fh = mock 'filehandle' fh.stubs :print - File.expects(:open).with(@certpath, "w").yields(fh) + Puppet.settings.expects(:writesub).with(@setting, @certpath).yields fh @searcher.save(@request) end |