Revision e687ec01 lib/hypervisor/hv_base.py

b/lib/hypervisor/hv_base.py
386 386
          key = splitfields[0].strip()
387 387
          val = splitfields[1].strip()
388 388
          if key == "MemTotal":
389
            result["memory_total"] = int(val.split()[0])/1024
389
            result["memory_total"] = int(val.split()[0]) / 1024
390 390
          elif key in ("MemFree", "Buffers", "Cached"):
391
            sum_free += int(val.split()[0])/1024
391
            sum_free += int(val.split()[0]) / 1024
392 392
          elif key == "Active":
393
            result["memory_dom0"] = int(val.split()[0])/1024
393
            result["memory_dom0"] = int(val.split()[0]) / 1024
394 394
    except (ValueError, TypeError), err:
395 395
      raise errors.HypervisorError("Failed to compute memory usage: %s" %
396 396
                                   (err,))

Also available in: Unified diff