diff --git a/app/models/manageiq/providers/cloud_manager/template.rb b/app/models/manageiq/providers/cloud_manager/template.rb index d92c6cbec61..458e8d9edf8 100644 --- a/app/models/manageiq/providers/cloud_manager/template.rb +++ b/app/models/manageiq/providers/cloud_manager/template.rb @@ -155,13 +155,15 @@ def self.display_name(number = 1) n_('Image', 'Images', number) end - def memory_for_request(request) - flavor_obj = Flavor.find(request.get_option(:instance_type)) + def memory_for_request(request, flavor_id = nil) + flavor_id ||= request.get_option(:instance_type) + flavor_obj = Flavor.find(flavor_id) flavor_obj.try(:memory) end - def number_of_cpus_for_request(request) - flavor_obj = Flavor.find(request.get_option(:instance_type)) + def number_of_cpus_for_request(request, flavor_id = nil) + flavor_id ||= request.get_option(:instance_type) + flavor_obj = Flavor.find(flavor_id) flavor_obj.try(:cpus) end