From 9ca0231498a85ee6a1272340cdfa319381abcd59 Mon Sep 17 00:00:00 2001 From: Steve Buzonas Date: Mon, 13 Jan 2014 11:49:20 -0500 Subject: [PATCH] modified ssh command to allow for connection without identity file e.g. key forwarding --- libraries/default.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/default.rb b/libraries/default.rb index b857292..fda290b 100644 --- a/libraries/default.rb +++ b/libraries/default.rb @@ -7,7 +7,8 @@ def hg_connection_command when "windows" cmd = "" else - cmd = "--ssh 'ssh -i #{new_resource.key} -o StrictHostKeyChecking=no'" + key_param = new_resource.key.nil? ? "" : "-i #{new_resource.key}" + cmd = "--ssh 'ssh #{key_param} -o StrictHostKeyChecking=no'" end return cmd end