Revision 7e1394dc

b/lib/hypervisor.py
73 73
    """Stop an instance."""
74 74
    raise NotImplementedError
75 75

  
76
  def RebootInstance(self, instance):
77
    """Reboot an instance."""
78
    raise NotImplementedError
79

  
76 80
  def ListInstances(self):
77 81
    """Get the list of running instances."""
78 82
    raise NotImplementedError
......
277 281
      raise HypervisorError("Failed to stop instance %s: %s" %
278 282
                            (instance.name, result.fail_reason))
279 283

  
284
  def RebootInstance(self, instance):
285
    """Reboot an instance."""
286
    result = utils.RunCmd(["xm", "reboot", instance.name])
287

  
288
    if result.failed:
289
      raise HypervisorError("Failed to reboot instance %s: %s" %
290
                            (instance.name, result.fail_reason))
291

  
280 292
  def GetNodeInfo(self):
281 293
    """Return information about the node.
282 294

  
......
438 450
                            (instance.name, "not running"))
439 451
    utils.RemoveFile(file_name)
440 452

  
453
  def RebootInstance(self, instance):
454
    """Reboot an instance.
455

  
456
    For the fake hypervisor, this does nothing.
457

  
458
    """
459
    return
460

  
441 461
  def GetNodeInfo(self):
442 462
    """Return information about the node.
443 463

  

Also available in: Unified diff