aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-12-16 17:33:04 +0100
committermh <mh@immerda.ch>2010-12-16 17:33:04 +0100
commitfa3d9e165404a5ed686d152002e5f7fd21b21e30 (patch)
tree2f2e95350e3b87bef57a3c5f695b87dec6d28655
parent584cee72362cf5b2d822164ef6569fe4671eabf6 (diff)
downloadpuppet-sshd-fa3d9e165404a5ed686d152002e5f7fd21b21e30.tar.gz
puppet-sshd-fa3d9e165404a5ed686d152002e5f7fd21b21e30.tar.bz2
do some trickery as arguments from puppet are passed as an array
-rw-r--r--lib/puppet/parser/functions/ssh_keygen.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/ssh_keygen.rb b/lib/puppet/parser/functions/ssh_keygen.rb
index 24efe62..09b3d3b 100644
--- a/lib/puppet/parser/functions/ssh_keygen.rb
+++ b/lib/puppet/parser/functions/ssh_keygen.rb
@@ -5,7 +5,7 @@ Puppet::Parser::Functions::newfunction(:ssh_keygen, :type => :rvalue, :doc =>
the directory hierarchy if required.
It accepts only fully qualified paths, everything else will fail.") do |args|
raise Puppet::ParseError, "Wrong number of arguments" unless args.to_a.length == 1
- private_key_path = args
+ private_key_path = args.to_a[0]
raise Puppet::ParseError, "Only fully qualified paths are accepted (#{private_key_path})" unless private_key_path =~ /^\/.+/
public_key_path = "#{private_key_path}.pub"
raise Puppet::ParseError, "Either only the private or only the public key exists" if File.exists?(private_key_path) ^ File.exists?(public_key_path)