From 57d2010db039e50e833d391490c0a6f7fa85b0dc Mon Sep 17 00:00:00 2001 From: Brandon High Date: Thu, 5 Mar 2020 17:17:30 -0800 Subject: [PATCH] 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. --- lib/vmpooler/providers/vsphere.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vmpooler/providers/vsphere.rb b/lib/vmpooler/providers/vsphere.rb index 6740423..91cea85 100644 --- a/lib/vmpooler/providers/vsphere.rb +++ b/lib/vmpooler/providers/vsphere.rb @@ -974,7 +974,7 @@ module Vmpooler if migration_enabled? @config 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") - return + break end run_select_hosts(pool_name, @provider_hosts) if vm_in_target?(pool_name, vm_hash['host_name'], vm_hash['architecture'], @provider_hosts)