summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2012-06-08 13:17:23 -0300
committermh <mh@immerda.ch>2012-06-08 13:17:23 -0300
commit8aab254eaa3c4fa99110b33c5064707e7a5bce6c (patch)
treeae4236291dfae65a39d99d3ef7b911dcb22c9ce4 /lib
parent8d0127b219afd864c857409d572537cf3247d9dc (diff)
recmkdir is gone
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/parser/functions/ssh_keygen.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/ssh_keygen.rb b/lib/puppet/parser/functions/ssh_keygen.rb
index 09b3d3b..597315e 100644
--- a/lib/puppet/parser/functions/ssh_keygen.rb
+++ b/lib/puppet/parser/functions/ssh_keygen.rb
@@ -14,7 +14,10 @@ Puppet::Parser::Functions::newfunction(:ssh_keygen, :type => :rvalue, :doc =>
end
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) }
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?