lib/zold/commands/remote.rb in zold-0.11.8 vs lib/zold/commands/remote.rb in zold-0.11.9
- old
+ new
@@ -153,11 +153,11 @@
res = r.http('/remotes').get
r.assert_code(200, res)
json = JSON.parse(res.body)
score = Score.parse_json(json['score'])
r.assert_valid_score(score)
- raise "Score too weak: #{score.strength}" if score.strength < Score::STRENGTH && !opts['ignore-score-weakness']
- raise "Masqueraded as #{score.host}:#{score.port}" if r.host != score.host || r.port != score.port
+ r.assert_score_ownership(score)
+ r.assert_score_strength(score) unless opts['ignore-score-weakness']
@remotes.rescore(score.host, score.port, score.value)
if opts['reboot'] && Semantic::Version.new(VERSION) < Semantic::Version.new(json['version'])
@log.info("#{r}: their version #{json['version']} is higher than mine #{VERSION}, reboot! \
(use --never-reboot to avoid this from happening)")
exit(0)