Skip to content

Commit

Permalink
Support memory to be shipped in KB
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamgilbert authored Oct 3, 2017
1 parent 35f66fe commit 90d8345
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1976,6 +1976,8 @@ def checkin(request):
machine.cpu_speed = hwinfo.get('current_processor_speed')
machine.memory = hwinfo.get('physical_memory')

if hwinfo.get('physical_memory')[-2:] == 'KB':
machine.memory_kb = int(hwinfo.get('physical_memory')[:-3])
if hwinfo.get('physical_memory')[-2:] == 'MB':
memory_mb = float(hwinfo.get('physical_memory')[:-3])
machine.memory_kb = int(memory_mb * 1024)
Expand Down

0 comments on commit 90d8345

Please sign in to comment.