Use consistent Style/NumericPredicate redux

Prior to this commit the codebase used the `zero?` method for comparing
to 0 on some places and not in others.
This commit makes all comparison to zero consistently use the `==`.
This commit is contained in:
Brandon High 2020-03-05 16:59:38 -08:00
parent daa1a99073
commit 5193ff6a84
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE
2 changed files with 8 additions and 8 deletions

View file

@ -619,7 +619,7 @@ module Vmpooler
_check_disk_queue
sleep(loop_delay)
unless maxloop.zero?
unless maxloop == 0
break if loop_count >= maxloop
loop_count += 1
@ -655,7 +655,7 @@ module Vmpooler
_check_snapshot_queue
sleep(loop_delay)
unless maxloop.zero?
unless maxloop == 0
break if loop_count >= maxloop
loop_count += 1
@ -816,7 +816,7 @@ module Vmpooler
end
sleep_with_wakeup_events(loop_delay, loop_delay_min, pool_size_change: true, poolname: pool['name'], pool_template_change: true, clone_target_change: true, pool_reset: true)
unless maxloop.zero?
unless maxloop == 0
break if loop_count >= maxloop
loop_count += 1
@ -1119,8 +1119,8 @@ module Vmpooler
$metrics.gauge("running.#{pool_name}", $redis.scard("vmpooler__running__#{pool_name}"))
if $redis.get("vmpooler__empty__#{pool_name}")
$redis.del("vmpooler__empty__#{pool_name}") unless ready.zero?
elsif ready.zero?
$redis.del("vmpooler__empty__#{pool_name}") unless ready == 0
elsif ready == 0
$redis.set("vmpooler__empty__#{pool_name}", 'true')
$logger.log('s', "[!] [#{pool_name}] is empty")
end
@ -1304,7 +1304,7 @@ module Vmpooler
sleep(loop_delay)
unless maxloop.zero?
unless maxloop == 0
break if loop_count >= maxloop
loop_count += 1