filecluster 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/fc/item.rb CHANGED
@@ -90,7 +90,7 @@ module FC
90
90
  rescue Exception => e
91
91
  FC::Error.raise "After copy error: #{e.message}", :item_id => id, :item_storage_id => item_storage.id
92
92
  else
93
- if md5_on_storage != md5
93
+ if md5 && md5_on_storage != md5
94
94
  item_storage.status = 'error'
95
95
  item_storage.save
96
96
  FC::Error.raise "Check md5 after copy error", :item_id => id, :item_storage_id => item_storage.id
data/lib/fc/storage.rb CHANGED
@@ -111,8 +111,9 @@ module FC
111
111
  # return object md5_sum on storage
112
112
  def md5_sum(file_name)
113
113
  dst_path = "#{self.path}#{file_name}"
114
- cmd = "find #{dst_path} -type f -exec md5sum {} \\; | awk '{print $1}' | sort | md5sum"
115
- cmd = "ssh -oBatchMode=yes -oStrictHostKeyChecking=no #{self.host} \"#{cmd}\"" if self.class.curr_host != host
114
+ cmd = self.class.curr_host == host ?
115
+ "find #{dst_path} -type f -exec md5sum {} \\; | awk '{print $1}' | sort | md5sum" :
116
+ "ssh -oBatchMode=yes -oStrictHostKeyChecking=no #{self.host} \"find #{dst_path} -type f -exec md5sum {} \\; | awk '{print \\$1}' | sort | md5sum\""
116
117
  r = `#{cmd} 2>&1`
117
118
  raise r if $?.exitstatus != 0
118
119
  r.to_s[0..31]
data/lib/fc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FC
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filecluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-25 00:00:00.000000000 Z
12
+ date: 2014-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rb-readline
@@ -193,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  segments:
195
195
  - 0
196
- hash: -1977585421026350925
196
+ hash: 3774757635760642720
197
197
  required_rubygems_version: !ruby/object:Gem::Requirement
198
198
  none: false
199
199
  requirements:
@@ -202,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
202
  version: '0'
203
203
  segments:
204
204
  - 0
205
- hash: -1977585421026350925
205
+ hash: 3774757635760642720
206
206
  requirements: []
207
207
  rubyforge_project:
208
208
  rubygems_version: 1.8.24