From 923ad45c5cba95fe68e0d1a4da8b09ee4f5c5b3b Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 13 Jun 2024 19:32:58 +0200 Subject: [PATCH] Use .dig() to simplify test code --- lib/fog/libvirt/requests/compute/dhcp_leases.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/fog/libvirt/requests/compute/dhcp_leases.rb b/lib/fog/libvirt/requests/compute/dhcp_leases.rb index a786078..eadd0ee 100644 --- a/lib/fog/libvirt/requests/compute/dhcp_leases.rb +++ b/lib/fog/libvirt/requests/compute/dhcp_leases.rb @@ -28,9 +28,7 @@ def dhcp_leases(uuid, mac, flags = 0) 'dd8fe884-6c02-601e-7551-cca97df1c5df' => leases1, 'fbd4ac68-cbea-4f95-86ed-22953fd92384' => leases2 } - if !networks[uuid].nil? - return networks[uuid][mac] - end + networks.dig(uuid, mac) end end end