Skip to content

Commit

Permalink
Merge pull request ManageIQ#140 from douglasgabriel/fix_bug_total_mem…
Browse files Browse the repository at this point in the history
…ory_ph_server

Fixing bug in the calculate of physical server total memory
  • Loading branch information
agrare authored Mar 15, 2018
2 parents 36d36fd + bb41a8b commit 085abc5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 085abc5

Please sign in to comment.