recmkdir is gone
This commit is contained in:
parent
8d0127b219
commit
8aab254eaa
3 changed files with 6 additions and 3 deletions
|
@ -14,7 +14,10 @@ Puppet::Parser::Functions::newfunction(:ssh_keygen, :type => :rvalue, :doc =>
|
||||||
end
|
end
|
||||||
|
|
||||||
dir = File.dirname(private_key_path)
|
dir = File.dirname(private_key_path)
|
||||||
Puppet::Util.recmkdir(dir,0700) unless File.directory?(dir)
|
unless File.directory?(dir)
|
||||||
|
require 'fileutils'
|
||||||
|
FileUtils.mkdir_p(dir, :mode => 0700)
|
||||||
|
end
|
||||||
unless [private_key_path,public_key_path].all?{|path| File.exists?(path) }
|
unless [private_key_path,public_key_path].all?{|path| File.exists?(path) }
|
||||||
output = Puppet::Util.execute(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', private_key_path, '-P', '', '-q'])
|
output = Puppet::Util.execute(['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', private_key_path, '-P', '', '-q'])
|
||||||
raise Puppet::ParseError, "Something went wrong during key generation! Output: #{output}" unless output.empty?
|
raise Puppet::ParseError, "Something went wrong during key generation! Output: #{output}" unless output.empty?
|
||||||
|
|
|
@ -74,7 +74,7 @@ describe "the ssh_keygen function" do
|
||||||
File.stubs(:exists?).with("/tmp/a/b/c").returns(false)
|
File.stubs(:exists?).with("/tmp/a/b/c").returns(false)
|
||||||
File.stubs(:exists?).with("/tmp/a/b/c.pub").returns(false)
|
File.stubs(:exists?).with("/tmp/a/b/c.pub").returns(false)
|
||||||
File.stubs(:directory?).with("/tmp/a/b").returns(false)
|
File.stubs(:directory?).with("/tmp/a/b").returns(false)
|
||||||
Puppet::Util.expects(:recmkdir).with("/tmp/a/b",0700)
|
FileUtils.expects(:mkdir_p).with("/tmp/a/b", :mode => 0700)
|
||||||
Puppet::Util.expects(:execute).returns("")
|
Puppet::Util.expects(:execute).returns("")
|
||||||
result = @scope.function_ssh_keygen('/tmp/a/b/c')
|
result = @scope.function_ssh_keygen('/tmp/a/b/c')
|
||||||
result.length.should == 2
|
result.length.should == 2
|
||||||
|
|
|
@ -95,7 +95,7 @@ AllowTcpForwarding <%= scope.lookupvar('sshd::tcp_forwarding') %>
|
||||||
X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
|
X11Forwarding <%= scope.lookupvar('sshd::x11_forwarding') %>
|
||||||
#X11DisplayOffset 10
|
#X11DisplayOffset 10
|
||||||
#X11UseLocalhost yes
|
#X11UseLocalhost yes
|
||||||
PrintMotd <%= sshd_print_motd %>
|
PrintMotd <%= scope.lookupvar('sshd::sshd_print_motd') %>
|
||||||
#PrintLastLog yes
|
#PrintLastLog yes
|
||||||
#TCPKeepAlive yes
|
#TCPKeepAlive yes
|
||||||
#UseLogin no
|
#UseLogin no
|
||||||
|
|
Loading…
Reference in a new issue