diff --git a/lib/fog/compute/models/aws/server.rb b/lib/fog/compute/models/aws/server.rb index 485ee64ed..4ff304ae6 100644 --- a/lib/fog/compute/models/aws/server.rb +++ b/lib/fog/compute/models/aws/server.rb @@ -200,12 +200,12 @@ module Fog Fog::SSH.new(public_ip_address, username, options).run(commands) end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) requires :public_ip_address, :username options = {} options[:key_data] = [private_key] if private_key - Fog::SCP.new(public_ip_address, username, options).upload(local_path, remote_path) + Fog::SCP.new(public_ip_address, username, options).upload(local_path, remote_path, recursive) end def start diff --git a/lib/fog/compute/models/bluebox/server.rb b/lib/fog/compute/models/bluebox/server.rb index 24fca51f2..36bec687b 100644 --- a/lib/fog/compute/models/bluebox/server.rb +++ b/lib/fog/compute/models/bluebox/server.rb @@ -128,12 +128,12 @@ module Fog Fog::SSH.new(ips.first['address'], username, options).run(commands) end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) requires :ips, :username options = {} options[:key_data] = [private_key] if private_key - Fog::SCP.new(ips.first['address'], username, options).upload(local_path, remote_path) + Fog::SCP.new(ips.first['address'], username, options).upload(local_path, remote_path, recursive) end def username diff --git a/lib/fog/compute/models/go_grid/server.rb b/lib/fog/compute/models/go_grid/server.rb index 57fb5fef7..540145246 100644 --- a/lib/fog/compute/models/go_grid/server.rb +++ b/lib/fog/compute/models/go_grid/server.rb @@ -78,12 +78,12 @@ module Fog Fog::SSH.new(ip['ip'], username, options).run(commands) end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) requires :ip, :username options = {} options[:key_data] = [private_key] if private_key - Fog::SCP.new(ip['ip'], username, options).upload(local_path, remote_path) + Fog::SCP.new(ip['ip'], username, options).upload(local_path, remote_path, recursive) end def setup(credentials = {}) diff --git a/lib/fog/compute/models/rackspace/server.rb b/lib/fog/compute/models/rackspace/server.rb index 121e4e4b1..3d0d1dd42 100644 --- a/lib/fog/compute/models/rackspace/server.rb +++ b/lib/fog/compute/models/rackspace/server.rb @@ -120,12 +120,12 @@ module Fog Fog::SSH.new(public_ip_address, username, options).run(commands) end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) requires :public_ip_address, :username options = {} options[:key_data] = [private_key] if private_key - Fog::SCP.new(public_ip_address, username, options).upload(local_path, remote_path) + Fog::SCP.new(public_ip_address, username, options).upload(local_path, remote_path, recursive) end def username diff --git a/lib/fog/compute/models/slicehost/server.rb b/lib/fog/compute/models/slicehost/server.rb index 3430bdf29..4c81407ed 100644 --- a/lib/fog/compute/models/slicehost/server.rb +++ b/lib/fog/compute/models/slicehost/server.rb @@ -110,12 +110,12 @@ module Fog Fog::SSH.new(addresses.first, username, options).run(commands) end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) requires :addresses, :username options = {} options[:key_data] = [private_key] if private_key - Fog::SCP.new(addresses.first, username, options).upload(local_path, remote_path) + Fog::SCP.new(addresses.first, username, options).upload(local_path, remote_path, recursive) end def username diff --git a/lib/fog/compute/models/virtual_box/server.rb b/lib/fog/compute/models/virtual_box/server.rb index 65ca9d5be..c32f600d7 100644 --- a/lib/fog/compute/models/virtual_box/server.rb +++ b/lib/fog/compute/models/virtual_box/server.rb @@ -151,7 +151,7 @@ module Fog end end - def scp(local_path, remote_path) + def scp(local_path, remote_path, recursive = false) raise 'Not Implemented' # requires :addresses, :username # diff --git a/lib/fog/core/scp.rb b/lib/fog/core/scp.rb index 37ceba5e0..6422c4b5d 100644 --- a/lib/fog/core/scp.rb +++ b/lib/fog/core/scp.rb @@ -23,7 +23,7 @@ module Fog @options = options end - def upload(local_path, remote_path) + def upload(local_path, remote_path, recursive = false ) Fog::Mock.not_implemented end @@ -45,10 +45,10 @@ module Fog @options = { :paranoid => false }.merge(options) end - def upload(local_path, remote_path) + def upload(local_path, remote_path, recursive = false ) begin Net::SCP.start(@address, @username, @options) do |scp| - scp.upload!(local_path, remote_path) do |ch, name, sent, total| + scp.upload!(local_path, remote_path, :recursive => recursive ) do |ch, name, sent, total| # TODO: handle progress display? end end