diff --git a/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/parser.rb b/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/parser.rb index a9bfe76241..908fcddddf 100644 --- a/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/parser.rb +++ b/app/models/manageiq/providers/lenovo/physical_infra_manager/parsers/parser.rb @@ -125,7 +125,8 @@ def get_disk_capacity(node) end def get_memory_info(node) - node.memoryModules&.reduce(0) { |total, mem| total + mem['capacity'] } + total_memory_gigabytes = node.memoryModules&.reduce(0) { |total, mem| total + mem['capacity'] } + total_memory_gigabytes * 1024 # convert to megabytes end def get_total_cores(node) diff --git a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb index c4044146f4..fc4e4efb41 100644 --- a/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb +++ b/spec/models/manageiq/providers/lenovo/physical_infra_manager/refresh_parser_spec.rb @@ -66,6 +66,12 @@ expect(child_device[:device_name]).to eq("Physical Port 1") end + it 'will retrieve the amout of memory in MB' do + physical_server = @result[:physical_servers][0] + memory_amount = physical_server[:computer_system][:hardware][:memory_mb] + expect(memory_amount).to eq(16_384) + end + it 'will retrieve disk capacity from a physical server' do physical_server_with_disk = @result[:physical_servers][0]