Revision dd875d32

b/daemons/ganeti-noded
620 620
    """Rename a job queue file.
621 621

  
622 622
    """
623
    (old, new) = params
624

  
625
    return backend.JobQueueRename(old, new)
623
    # TODO: What if a file fails to rename?
624
    return [backend.JobQueueRename(old, new) for old, new in params]
626 625

  
627 626
  @staticmethod
628 627
  def perspective_jobqueue_set_drain(params):
b/lib/jqueue.py
713 713
    @param rename: List containing tuples mapping old to new names
714 714

  
715 715
    """
716
    # Rename them locally
716 717
    for old, new in rename:
717 718
      utils.RenameFile(old, new, mkdir=True)
718 719

  
719
      names, addrs = self._GetNodeIp()
720
      result = rpc.RpcRunner.call_jobqueue_rename(names, addrs, old, new)
721
      self._CheckRpcResult(result, self._nodes,
722
                           "Moving %s to %s" % (old, new))
720
    # ... and on all nodes
721
    names, addrs = self._GetNodeIp()
722
    result = rpc.RpcRunner.call_jobqueue_rename(names, addrs, rename)
723
    self._CheckRpcResult(result, self._nodes, "Renaming files (%r)" % rename)
723 724

  
724 725
  def _FormatJobID(self, job_id):
725 726
    """Convert a job ID to string format.
b/lib/rpc.py
943 943
    return cls._StaticSingleNodeCall(node, "jobqueue_purge", [])
944 944

  
945 945
  @classmethod
946
  def call_jobqueue_rename(cls, node_list, address_list, old, new):
946
  def call_jobqueue_rename(cls, node_list, address_list, rename):
947 947
    """Rename a job queue file.
948 948

  
949 949
    This is a multi-node call.
950 950

  
951 951
    """
952
    return cls._StaticMultiNodeCall(node_list, "jobqueue_rename", [old, new],
952
    return cls._StaticMultiNodeCall(node_list, "jobqueue_rename", rename,
953 953
                                    address_list=address_list)
954 954

  
955 955
  @classmethod

Also available in: Unified diff