Revision 1268d6fd

b/daemons/ganeti-noded
364 364
    """
365 365
    inst_s = params[0]
366 366
    inst = objects.Instance.FromDict(inst_s)
367
    return backend.AddOSToInstance(inst)
367
    return backend.InstanceOsAdd(inst)
368 368

  
369 369
  @staticmethod
370 370
  def perspective_instance_run_rename(params):
b/lib/backend.py
669 669
  return output
670 670

  
671 671

  
672
def AddOSToInstance(instance):
672
def InstanceOsAdd(instance):
673 673
  """Add an OS to an instance.
674 674

  
675 675
  @type instance: L{objects.Instance}
......
678 678
  @return: the success of the operation
679 679

  
680 680
  """
681
  inst_os = OSFromDisk(instance.os)
681
  try:
682
    inst_os = OSFromDisk(instance.os)
683
  except errors.InvalidOS, err:
684
    os_name, os_dir, os_err = err.args
685
    if os_dir is None:
686
      return (False, "Can't find OS '%s': %s" % (os_name, os_err))
687
    else:
688
      return (False, "Error parsing OS '%s' in directory %s: %s" %
689
              (os_name, os_dir, os_err))
682 690

  
683 691
  create_env = OSEnvironment(instance)
684 692

  

Also available in: Unified diff