filecluster 0.5.8 → 0.5.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc12e92010113085a66dea7bfbac267f67768247
4
- data.tar.gz: 80afdcb6ec68e4b282e359bd75cc46975787a22b
3
+ metadata.gz: 3f60e5ac0d24dbb13cd23102a51c0c044fb3cd01
4
+ data.tar.gz: 36808f3fbf80cb1af4149259d85dc409d3bf093a
5
5
  SHA512:
6
- metadata.gz: b67df5a734df911038c68f9b2780f355357adfec7865af7cacb55c661c09cb719dbec6f7d038d2cccb79dd9dee423391898efdcf9b98236cb6d2b0c01e46fd4e
7
- data.tar.gz: 1d7eb36494a02a57c786da0a53c65bc60e280d13abd438e391384607a1f25951dc79584579d739d7d96a2c2a863ece8fa8d6dc7bc7dc639a7c5ac51cda9bbf37
6
+ metadata.gz: 39e08fe5acf73bd152b30d68b74536dbabb57c30722ce7606a597d383680ff1b3db1432cec8467c9fce6d8e15a501035d0c61fe7a45a09deffb73b8e46509b52
7
+ data.tar.gz: 0499dfd3ab6bfa66cfc9589d937235d61d8578160184194d6e8afc2b98f3e3cc6737c3cc762d82bc3e8f2c5934c0bc95f0578cecd86a66fed5b779a5fc261b97
data/lib/fc/item.rb CHANGED
@@ -78,8 +78,7 @@ module FC
78
78
  FC::DB.query("UPDATE #{FC::ItemStorage.table_name} SET status='delete' WHERE item_id = #{item.id} AND storage_name <> '#{storage.name}'") if options[:replace]
79
79
 
80
80
  item_storage = item.make_item_storage(storage)
81
- speed_limit = options[:speed_limit].present? ? options[:speed_limit] : nil
82
- item.copy_item_storage(local_path, storage, item_storage, options[:remove_local], speed_limit)
81
+ item.copy_item_storage(local_path, storage, item_storage, options[:remove_local], options[:speed_limit])
83
82
  end
84
83
 
85
84
  return item
data/lib/fc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FC
2
- VERSION = '0.5.8'.freeze
2
+ VERSION = '0.5.9'.freeze
3
3
  end
data/test/daemon_test.rb CHANGED
@@ -23,7 +23,7 @@ class DaemonTest < Test::Unit::TestCase
23
23
  FC::Var.set('daemon_global_error_items_ttl', 2)
24
24
  @stotage_checks = 0
25
25
  Thread.new do
26
- Open3.popen2e("#{daemon_bin} -c #{db_config_file} -l debug -h host1") do |stdin, stdout, t|
26
+ Open3.popen2e("#{daemon_bin} -c #{db_config_file} -l debug -h localhost") do |stdin, stdout, t|
27
27
  @@pid = t.pid
28
28
  while line = stdout.readline
29
29
  @stotage_checks += 1 if line =~ /Finish stotage check/i
@@ -47,21 +47,21 @@ class DaemonTest < Test::Unit::TestCase
47
47
  @@storages = []
48
48
  @@storages << FC::Storage.new(
49
49
  :name => 'host1-sda',
50
- :host => 'host1',
50
+ :host => 'localhost',
51
51
  :path => '/tmp/host1-sda/',
52
52
  :copy_storages => 'host1-sdb,host1-sdc',
53
53
  :size_limit => 1_000_000_000
54
54
  )
55
55
  @@storages << FC::Storage.new(
56
56
  :name => 'host1-sdb',
57
- :host => 'host1',
57
+ :host => 'localhost',
58
58
  :path => '/tmp/host1-sdb/',
59
59
  :copy_storages => 'host1-sda,host1-sdc',
60
60
  :size_limit => 1_000_000_000
61
61
  )
62
62
  @@storages << FC::Storage.new(
63
63
  :name => 'host1-sdc',
64
- :host => 'host1',
64
+ :host => 'localhost',
65
65
  :path => '/tmp/host1-sdc/',
66
66
  :copy_storages => 'host1-sda,host1-sdb',
67
67
  :size_limit => 1_000_000_000
@@ -104,8 +104,6 @@ class DaemonTest < Test::Unit::TestCase
104
104
  assert @@storages[1].up?, "Storage #{@@storages[1].name} down"
105
105
  assert @@storages[2].up?, "Storage #{@@storages[2].name} down"
106
106
 
107
- FC::Storage.any_instance.stubs(:host).returns('host1')
108
- FC::Storage.stubs(:curr_host).returns('host1')
109
107
  assert_nothing_raised { @item1 = make_file_item('bla/bla/test1', 'test1') }
110
108
  assert_nothing_raised { @item2 = make_file_item('bla/bla/test2', 'test2') }
111
109
  assert_nothing_raised { @item3 = make_dir_item('bla/bla/test3', 'test3') }
@@ -12,7 +12,7 @@ class StorageSyncTest < Test::Unit::TestCase
12
12
  @@test_file_path = '/tmp/fc_test_file'
13
13
  `dd if=/dev/urandom of=#{@@test_file_path} bs=1M count=1 2>&1`
14
14
 
15
- @@storage = FC::Storage.new(:name => 'host1-sda', :host => 'host1', :path => '/tmp/host1-sda/', :size_limit => 1000000000, :check_time => Time.new.to_i)
15
+ @@storage = FC::Storage.new(:name => 'host1-sda', :host => 'localhost', :path => '/tmp/host1-sda/', :size_limit => 1000000000, :check_time => Time.new.to_i)
16
16
  @@storage.save
17
17
  @@policy = FC::Policy.new(:create_storages => 'host1-sda', :copies => 1, :name => 'policy 1')
18
18
  @@policy.save
@@ -28,11 +28,6 @@ class StorageSyncTest < Test::Unit::TestCase
28
28
  end
29
29
  end
30
30
 
31
- def setup
32
- FC::Storage.any_instance.stubs(:host).returns('host1')
33
- FC::Storage.stubs(:curr_host).returns('host1')
34
- end
35
-
36
31
  should "sync_all" do
37
32
  assert_nothing_raised { @item1 = FC::Item.create_from_local(@@test_file_path, 'a/test1', @@policy, {:tag => 'test'}) }
38
33
  assert_nothing_raised { @item2 = FC::Item.create_from_local(@@test_file_path, 'a/b/test2', @@policy, {:tag => 'test'}) }
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.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - sh