From 39b5bb4beb743147ed8c6626b576fe83cdf7cc47 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Tue, 26 May 2020 13:16:48 -0700 Subject: [PATCH] Simplify selecting disk from all_disks hash --- plugins/providers/hyperv/cap/configure_disks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/providers/hyperv/cap/configure_disks.rb b/plugins/providers/hyperv/cap/configure_disks.rb index 71128ca44..152042354 100644 --- a/plugins/providers/hyperv/cap/configure_disks.rb +++ b/plugins/providers/hyperv/cap/configure_disks.rb @@ -52,7 +52,7 @@ module VagrantPlugins # We can't rely on the order of `all_disks`, as they will not # always come in port order, but primary should always be Location 0 Number 0. - current_disk = all_disks.select { |d| d["ControllerLocation"] == 0 && d["ControllerNumber"] == 0 }.first + current_disk = all_disks.detect { |d| d["ControllerLocation"] == 0 && d["ControllerNumber"] == 0 } # Need to get actual disk info to obtain UUID instead of what's returned #