Use break instead of return in migrate_vm connection pool

This commit switches the early `return` in `migrate_vm`'s connection
pooling block to a `break`, since `return` implies you are returning
something from a method and I don't think `migrate_vm` wants to do that.

This is a place where a partial type system like Sorbet seems useful
because then we'd have some idea about what the intended return is here.
This commit is contained in:
Brandon High 2020-03-05 17:17:30 -08:00
parent 392232fb6a
commit 57d2010db0
No known key found for this signature in database
GPG key ID: 270079C784FCAFDE

View file

@ -974,7 +974,7 @@ module Vmpooler
if migration_enabled? @config if migration_enabled? @config
if migration_count >= migration_limit if migration_count >= migration_limit
logger.log('s', "[ ] [#{pool_name}] '#{vm_name}' is running on #{vm_hash['host_name']}. No migration will be evaluated since the migration_limit has been reached") logger.log('s', "[ ] [#{pool_name}] '#{vm_name}' is running on #{vm_hash['host_name']}. No migration will be evaluated since the migration_limit has been reached")
return break
end end
run_select_hosts(pool_name, @provider_hosts) run_select_hosts(pool_name, @provider_hosts)
if vm_in_target?(pool_name, vm_hash['host_name'], vm_hash['architecture'], @provider_hosts) if vm_in_target?(pool_name, vm_hash['host_name'], vm_hash['architecture'], @provider_hosts)