Revision 20e01edd

b/lib/backend.py
681 681
    logging.error("os create command '%s' returned error: %s, logfile: %s,"
682 682
                  " output: %s", result.cmd, result.fail_reason, logfile,
683 683
                  result.output)
684
    return False
684
    lines = [val.encode("string_escape")
685
             for val in utils.TailFile(logfile, lines=20)]
686
    return (False, "OS create script failed (%s), last lines in the"
687
            " log file:\n%s" % (result.fail_reason, "\n".join(lines)))
685 688

  
686
  return True
689
  return (True, "Successfully installed")
687 690

  
688 691

  
689 692
def RunRenameInstance(instance, old_name):
b/lib/cmdlib.py
2837 2837
    try:
2838 2838
      feedback_fn("Running the instance OS create scripts...")
2839 2839
      result = self.rpc.call_instance_os_add(inst.primary_node, inst)
2840
      result.Raise()
2841
      if not result.data:
2840
      msg = result.RemoteFailMsg()
2841
      if msg:
2842 2842
        raise errors.OpExecError("Could not install OS for instance %s"
2843
                                 " on node %s" %
2844
                                 (inst.name, inst.primary_node))
2843
                                 " on node %s: %s" %
2844
                                 (inst.name, inst.primary_node, msg))
2845 2845
    finally:
2846 2846
      _ShutdownInstanceDisks(self, inst)
2847 2847

  
......
4512 4512
      if self.op.mode == constants.INSTANCE_CREATE:
4513 4513
        feedback_fn("* running the instance OS create scripts...")
4514 4514
        result = self.rpc.call_instance_os_add(pnode_name, iobj)
4515
        result.Raise()
4516
        if not result.data:
4515
        msg = result.RemoteFailMsg()
4516
        if msg:
4517 4517
          raise errors.OpExecError("Could not add os for instance %s"
4518
                                   " on node %s" %
4519
                                   (instance, pnode_name))
4518
                                   " on node %s: %s" %
4519
                                   (instance, pnode_name, msg))
4520 4520

  
4521 4521
      elif self.op.mode == constants.INSTANCE_IMPORT:
4522 4522
        feedback_fn("* running the instance OS import scripts...")

Also available in: Unified diff