six-rsync 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/rsync/lib.rb +32 -16
  3. data/lib/six/rsync.rb +1 -1
  4. metadata +2 -2
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-rsync'
15
- s.version = '0.3.4'
15
+ s.version = '0.3.5'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
data/lib/six/rsync/lib.rb CHANGED
@@ -127,27 +127,43 @@ module Six
127
127
  raise RsyncError
128
128
  end
129
129
 
130
- #unpack
130
+ hosts = config[:hosts].clone
131
131
 
132
132
  # FIXME: This does not work when not forced, as host is sampled in comparesums :)
133
- host = config[:hosts].sample
133
+ host = hosts.sample
134
134
 
135
135
  if opts[:force]
136
- @logger.info "Trying: #{host}, please wait..."
137
- arr_opts = []
138
- arr_opts << PARAMS
139
- arr_opts += x_opts
140
- if host[/\A(\w)*\@/]
141
- arr_opts << RSH#"-e ssh"
142
- end
143
-
144
- # TODO: UNCLUSTERFUCK
145
- arr_opts << esc(File.join(host, '.pack/.'))
146
- arr_opts << esc(pack_path)
136
+ done = false
137
+ b = false
138
+ verbose = @verbose
139
+ @verbose = false
140
+ while hosts.size > 0 && !done do
141
+ # FIXME: Nasty
142
+ host = hosts.sample if b
143
+ b = true
144
+ hosts -= [host]
145
+ @logger.info "Trying #{host}"
147
146
 
148
- command(cmd, arr_opts)
149
- calc
150
- save_repos
147
+ begin
148
+ arr_opts = []
149
+ arr_opts << PARAMS
150
+ arr_opts += x_opts
151
+ if host[/\A(\w)*\@/]
152
+ arr_opts << RSH#"-e ssh"
153
+ end
154
+ # TODO: UNCLUSTERFUCK
155
+ arr_opts << esc(File.join(host, '.pack/.'))
156
+ arr_opts << esc(pack_path)
157
+ command(cmd, arr_opts)
158
+ calc
159
+ save_repos
160
+ done = true
161
+ rescue
162
+ @logger.debug "#{$!}"
163
+ end
164
+ end
165
+ @verbose = verbose
166
+ raise RsyncError if !done
151
167
  else
152
168
  #reset(:hard => true)
153
169
  calc
data/lib/six/rsync.rb CHANGED
@@ -30,7 +30,7 @@ module Six
30
30
  end
31
31
 
32
32
  module Rsync
33
- VERSION = '0.3.4'
33
+ VERSION = '0.3.5'
34
34
  TOOLS_PATH = File.join(BASE_PATH, 'tools')
35
35
 
36
36
  FOLDER = /(.*)\/(.*)/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-12 00:00:00 +01:00
12
+ date: 2010-02-06 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency