Revision d0c8c01d lib/hypervisor/hv_base.py

b/lib/hypervisor/hv_base.py
242 242
    @return: instance migration information - serialized form
243 243

  
244 244
    """
245
    return ''
245
    return ""
246 246

  
247 247
  def AcceptInstance(self, instance, info, target):
248 248
    """Prepare to accept an instance.
......
381 381
        if len(splitfields) > 1:
382 382
          key = splitfields[0].strip()
383 383
          val = splitfields[1].strip()
384
          if key == 'MemTotal':
385
            result['memory_total'] = int(val.split()[0])/1024
386
          elif key in ('MemFree', 'Buffers', 'Cached'):
384
          if key == "MemTotal":
385
            result["memory_total"] = int(val.split()[0])/1024
386
          elif key in ("MemFree", "Buffers", "Cached"):
387 387
            sum_free += int(val.split()[0])/1024
388
          elif key == 'Active':
389
            result['memory_dom0'] = int(val.split()[0])/1024
388
          elif key == "Active":
389
            result["memory_dom0"] = int(val.split()[0])/1024
390 390
    except (ValueError, TypeError), err:
391 391
      raise errors.HypervisorError("Failed to compute memory usage: %s" %
392 392
                                   (err,))
393
    result['memory_free'] = sum_free
393
    result["memory_free"] = sum_free
394 394

  
395 395
    cpu_total = 0
396 396
    try:
......
402 402
        fh.close()
403 403
    except EnvironmentError, err:
404 404
      raise errors.HypervisorError("Failed to list node info: %s" % (err,))
405
    result['cpu_total'] = cpu_total
405
    result["cpu_total"] = cpu_total
406 406
    # FIXME: export correct data here
407
    result['cpu_nodes'] = 1
408
    result['cpu_sockets'] = 1
407
    result["cpu_nodes"] = 1
408
    result["cpu_sockets"] = 1
409 409

  
410 410
    return result
411 411

  

Also available in: Unified diff