zold 0.13.38 → 0.13.39
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 +4 -4
- data/fixtures/scripts/redeploy-on-upgrade.sh +1 -1
- data/lib/zold/commands/node.rb +1 -1
- data/lib/zold/commands/remote.rb +8 -1
- data/lib/zold/version.rb +1 -1
- data/test/commands/test_remote.rb +3 -3
- data/test/node/test_front.rb +3 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47d9dcf9ec8a2a32dffe47e6e2c9d5edc94d3d09
|
4
|
+
data.tar.gz: 1ed5c3c3dd87b804bd7cdfff3e489d37ef39faee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d457fc55f2647038d922b1d047d952b75282650fc6744ce70d6a476ddcc1d744f54ea861d59fc70e289b9e8cf4ad8f283ea17d19cbd710b12db195527a165ab
|
7
|
+
data.tar.gz: 2fc54011ff8fe3b23b05839f73ee4b7ec1f5281424a6c5d5f9b785a8319b328a3f6acde934cd703dd6e441a1e0e80628189f4d8113117452f4505fc48160aecb
|
@@ -18,7 +18,7 @@ primary=$(start_node ${high} 9.9.9 --standalone)
|
|
18
18
|
|
19
19
|
low=$(reserve_port)
|
20
20
|
secondary=$(start_node ${low} 1.1.1)
|
21
|
-
zold remote add localhost ${high} --home=${low}
|
21
|
+
zold remote add localhost ${high} --home=${low} --skip-ping
|
22
22
|
|
23
23
|
trap "kill -9 ${primary} ${secondary}" EXIT
|
24
24
|
|
data/lib/zold/commands/node.rb
CHANGED
@@ -246,7 +246,7 @@ module Zold
|
|
246
246
|
metronome = Metronome.new(@log)
|
247
247
|
require_relative 'routines/spread'
|
248
248
|
metronome.add(Routines::Spread.new(opts, @wallets, entrance, log: @log))
|
249
|
-
unless opts[
|
249
|
+
unless opts['standalone']
|
250
250
|
require_relative 'routines/reconnect'
|
251
251
|
metronome.add(Routines::Reconnect.new(opts, @remotes, farm, log: @log))
|
252
252
|
end
|
data/lib/zold/commands/remote.rb
CHANGED
@@ -75,6 +75,9 @@ Available options:"
|
|
75
75
|
o.bool '--force',
|
76
76
|
'Add/remove if if this operation is not possible',
|
77
77
|
default: false
|
78
|
+
o.bool '--skip-ping',
|
79
|
+
'Don\'t ping back the node when adding it (not recommended)',
|
80
|
+
default: false
|
78
81
|
o.bool '--reboot',
|
79
82
|
'Exit if any node reports version higher than we have',
|
80
83
|
default: false
|
@@ -126,6 +129,10 @@ Available options:"
|
|
126
129
|
end
|
127
130
|
|
128
131
|
def add(host, port, opts)
|
132
|
+
unless opts['skip-ping']
|
133
|
+
res = Http.new("http://#{host}:#{port}/version").get
|
134
|
+
raise "The node #{host}:#{port} is not responding" unless res.code == '200'
|
135
|
+
end
|
129
136
|
if @remotes.exists?(host, port)
|
130
137
|
raise "#{host}:#{port} already exists in the list" unless opts['force']
|
131
138
|
@log.debug("#{host}:#{port} already exists in the list")
|
@@ -213,7 +220,7 @@ in #{(Time.now - start).round(2)}s")
|
|
213
220
|
end
|
214
221
|
total = @remotes.all.size
|
215
222
|
if total.zero?
|
216
|
-
@log.debug("The list of remotes is #{Rainbow('empty').red}, run 'zold reset'!")
|
223
|
+
@log.debug("The list of remotes is #{Rainbow('empty').red}, run 'zold remote reset'!")
|
217
224
|
else
|
218
225
|
@log.debug("There are #{total} known remotes")
|
219
226
|
end
|
data/lib/zold/version.rb
CHANGED
@@ -62,10 +62,10 @@ class TestRemote < Minitest::Test
|
|
62
62
|
cmd = Zold::Remote.new(remotes: remotes, log: test_log)
|
63
63
|
cmd.run(%w[remote clean])
|
64
64
|
assert(remotes.all.empty?)
|
65
|
-
cmd.run(['remote', 'add', zero.host, zero.port.to_s])
|
66
|
-
cmd.run(%w[remote add localhost 2])
|
65
|
+
cmd.run(['remote', 'add', zero.host, zero.port.to_s, '--skip-ping'])
|
66
|
+
cmd.run(%w[remote add localhost 2 --skip-ping])
|
67
67
|
assert_equal(2, remotes.all.count)
|
68
|
-
cmd.run(['remote', 'update', '--ignore-score-weakness'])
|
68
|
+
cmd.run(['remote', 'update', '--ignore-score-weakness', '--skip-ping'])
|
69
69
|
assert_equal(4, remotes.all.count)
|
70
70
|
end
|
71
71
|
end
|
data/test/node/test_front.rb
CHANGED
@@ -61,13 +61,11 @@ class FrontTest < Minitest::Test
|
|
61
61
|
def test_updates_list_of_remotes
|
62
62
|
FakeNode.new(log: test_log).run(['--ignore-score-weakness']) do |port|
|
63
63
|
score = Zold::Score.new(
|
64
|
-
Time.now, '
|
65
|
-
999, 'NOPREFIX@ffffffffffffffff',
|
66
|
-
strength: 1
|
64
|
+
Time.now, 'localhost', port, 'NOPREFIX@ffffffffffffffff', strength: 1
|
67
65
|
).next.next.next.next
|
68
66
|
response = Zold::Http.new("http://localhost:#{port}/remotes", score).get
|
69
|
-
|
70
|
-
assert_equal(1, Zold::JsonPage.new(body).to_hash['all'].count, body)
|
67
|
+
assert_equal('200', response.code, response.body)
|
68
|
+
assert_equal(1, Zold::JsonPage.new(response.body).to_hash['all'].count, response.body)
|
71
69
|
end
|
72
70
|
end
|
73
71
|
|