From dd03bba4e476f1d2f60a67296814b69eac7b25cb Mon Sep 17 00:00:00 2001 From: Kees van Veen Date: Mon, 7 Oct 2024 13:38:15 +0200 Subject: [PATCH] another attempt to comply with rubocop --- .../foreman_fog_proxmox/proxmox_volumes.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/models/foreman_fog_proxmox/proxmox_volumes.rb b/app/models/foreman_fog_proxmox/proxmox_volumes.rb index 400172830..824a382a6 100644 --- a/app/models/foreman_fog_proxmox/proxmox_volumes.rb +++ b/app/models/foreman_fog_proxmox/proxmox_volumes.rb @@ -33,21 +33,20 @@ def update_extra_volumes_definitions(data_in) # Start to look into the data that needs to be updated volumes_attributes = {} value.each do |index, dev_specs| - nr_of_keys_found = dev_specs.keys.count # Only if this contains only 1 set like: {"size"=>"xxGB"} - if #{index} > 0 && nr_of_keys_found == 1 + if #{index} > 0 && dev_specs.keys.count == 1 # Copy the data from the first entry - newid = "#{value['0']['controller']}#{index}" + newid = "#{value['0']['controller']}#{index}" newdev = { 'storage_type' => value['0']['storage_type'], - 'storage' => value['0']['storage'], - 'controller' => value['0']['controller'], - 'cache' => value['0']['cache'], - 'device' => index, - 'id' => newid, - 'size' => dev_specs['size'], + 'storage' => value['0']['storage'], + 'controller' => value['0']['controller'], + 'cache' => value['0']['cache'], + 'device' => index, + 'id' => newid, + 'size' => dev_specs['size'], } volumes_attributes[index] = newdev else