[DRE-commits] [vagrant-libvirt] 34/67: fix for ssh keys from(copied from vagrant-aws)

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Apr 24 13:56:03 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag 0.0.14
in repository vagrant-libvirt.

commit f9f83749f4434d7555dceaed685e8458327c1773
Author: dima <pronix.service at gmail.com>
Date:   Tue Dec 17 08:20:19 2013 +0100

    fix for ssh keys from(copied from vagrant-aws)
---
 lib/vagrant-libvirt/action/sync_folders.rb | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/vagrant-libvirt/action/sync_folders.rb b/lib/vagrant-libvirt/action/sync_folders.rb
index edd9908..0ba0c60 100644
--- a/lib/vagrant-libvirt/action/sync_folders.rb
+++ b/lib/vagrant-libvirt/action/sync_folders.rb
@@ -27,7 +27,7 @@ module VagrantPlugins
             # avoid creating an additional directory with rsync
             hostpath = "#{hostpath}/" if hostpath !~ /\/$/
 
-            env[:ui].info(I18n.t("vagrant_libvirt.rsync_folder",
+            env[:ui].info(I18n.t('vagrant_libvirt.rsync_folder',
                                 :hostpath => hostpath,
                                 :guestpath => guestpath))
 
@@ -38,9 +38,9 @@ module VagrantPlugins
 
             # Rsync over to the guest path using the SSH info
             command = [
-              "rsync", "--del", "--verbose", "--archive", "-z",
-              "--exclude", ".vagrant/",
-              "-e", "ssh -p #{ssh_info[:port]} #{proxycommand} -o StrictHostKeyChecking=no -i '#{ssh_info[:private_key_path]}'",
+              'rsync', '--del', '--verbose', '--archive', '-z',
+              '--exclude', '.vagrant/',
+              '-e', "ssh -p #{ssh_info[:port]} #{proxycommand} -o StrictHostKeyChecking=no  #{ssh_key_options(ssh_info)}",
               hostpath,
               "#{ssh_info[:username]}@#{ssh_info[:host]}:#{guestpath}"]
 
@@ -53,6 +53,12 @@ module VagrantPlugins
             end
           end
         end
+        private
+
+        def ssh_key_options(ssh_info)
+          # Ensure that `private_key_path` is an Array (for Vagrant < 1.4)
+          Array(ssh_info[:private_key_path]).map { |path| "-i '#{path}' " }.join
+        end
       end
     end
   end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/vagrant-libvirt.git



More information about the Pkg-ruby-extras-commits mailing list