From cfca0b6d69014677438f88e7f534ec3496029662 Mon Sep 17 00:00:00 2001 From: Jay Carman Date: Thu, 31 Aug 2023 05:55:05 -0500 Subject: [PATCH] Use MiqTemplate methods to calculate cpus and mem --- .../QuotaMethods.class/__methods__/requested.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb b/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb index d2a7d7269..33c83ff23 100644 --- a/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb +++ b/content/automate/ManageIQ/System/CommonMethods/QuotaMethods.class/__methods__/requested.rb @@ -291,15 +291,17 @@ def cloud_volume_storage(args_hash) end def cloud_number_of_cpus(args_hash) - flavor = args_hash[:flavor] - $evm.log(:info, "Retrieving cloud flavor #{flavor.name} cpus => #{flavor.cpus}") - default_option(flavor.cpus, args_hash[:options_array]) + default_option( + args_hash[:resource].source.number_of_cpus_for_request(args_hash[:resource]), + args_hash[:options_array] + ) end def cloud_vm_memory(args_hash) - flavor = args_hash[:flavor] - $evm.log(:info, "Retrieving flavor #{flavor.name} memory => #{flavor.memory}") - default_option(flavor.memory, args_hash[:options_array]) + default_option( + args_hash[:resource].source.memory_for_request(args_hash[:resource]), + args_hash[:options_array] + ) end def cloud_value(args_hash)