From eab6d1ab78ceb823c57fe539774b04146e077899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=20G=C3=B3mez?= Date: Sat, 9 Nov 2024 17:52:34 +0000 Subject: [PATCH] Refactor allocated_bytes --- resources/libraries/harddisk_services.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/libraries/harddisk_services.rb b/resources/libraries/harddisk_services.rb index 8cafa15..2eb018f 100644 --- a/resources/libraries/harddisk_services.rb +++ b/resources/libraries/harddisk_services.rb @@ -6,8 +6,7 @@ def harddisk_services node['redborder']['manager']['hd_services'].each do |service| service_name = service['name'] service_count = service['count'] - porcentage = service_count / 100 - allocated_bytes = root_dev_bytes * porcentage + allocated_bytes = root_dev_bytes * (service_count.to_f / 100) hd_services[service_name] = allocated_bytes.to_i end hd_services # hard disk services sizes are pased in bytes