CloudyScripts 1.5.18 → 1.5.19

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'CloudyScripts'
15
- s.version = '1.5.18'
15
+ s.version = '1.5.19'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README.rdoc', 'LICENSE']
18
18
  s.summary = 'Scripts to facilitate programming for infrastructure clouds.'
@@ -136,6 +136,13 @@ class RemoteCommandHandler
136
136
  remote_exec_helper(e, nil, nil, false) #TODO: handle output in stderr?
137
137
  end
138
138
 
139
+ # Copy directory via an ssh-tunnel.
140
+ def scp(keyfile, source_path, dest_ip, dest_path)
141
+ e = "scp -Cpqr -o stricthostkeychecking=no -i #{keyfile} #{source_path} root@#{dest_ip}:#{dest_path}"
142
+ @logger.debug "going to execute #{e}"
143
+ remote_exec_helper(e, nil, nil, false) #TODO: handle output in stderr?
144
+ end
145
+
139
146
  # Zip the complete contents of the source path into the destination file.
140
147
  # Returns the an array with stderr output messages.
141
148
  def zip(source_path, destination_file)
@@ -446,7 +446,13 @@ module StateTransitionHelper
446
446
 
447
447
  def remote_copy(keyname, source_dir, dest_machine, dest_dir)
448
448
  post_message("going to remote copy all files from volume. This may take some time...")
449
- remote_handler().remote_rsync("/root/.ssh/#{keyname}.pem", source_dir, dest_machine, dest_dir)
449
+ if remote_handler().tools_installed?("rsync")
450
+ @logger.debug "use rsync command"
451
+ remote_handler().remote_rsync("/root/.ssh/#{keyname}.pem", source_dir, dest_machine, dest_dir)
452
+ else
453
+ @logger.debug "use scp command"
454
+ remote_handler().scp("/root/.ssh/#{keyname}.pem", source_dir, dest_machine, dest_dir)
455
+ end
450
456
  post_message("remote copy operation done")
451
457
  end
452
458
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 18
9
- version: 1.5.18
8
+ - 19
9
+ version: 1.5.19
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matthias Jung
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-06 00:00:00 +02:00
17
+ date: 2010-10-13 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency