fix deprecation warning 'Puppet::Util.execute is deprecated; please use Puppet::Util::Execution.execute'
This commit is contained in:
parent
19218d6b02
commit
6578e0c918
1 changed files with 3 additions and 1 deletions
|
@ -19,7 +19,9 @@ Puppet::Parser::Functions::newfunction(:ssh_keygen, :type => :rvalue, :doc =>
|
||||||
FileUtils.mkdir_p(dir, :mode => 0700)
|
FileUtils.mkdir_p(dir, :mode => 0700)
|
||||||
end
|
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::Execution.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?
|
||||||
end
|
end
|
||||||
[File.read(private_key_path),File.read(public_key_path)]
|
[File.read(private_key_path),File.read(public_key_path)]
|
||||||
|
|
Loading…
Reference in a new issue