Revision 941b9309 lib/rapi/rlib2.py

b/lib/rapi/rlib2.py
389 389
    node_name = self.items[0]
390 390
    remote_node = self._checkStringVariable("remote_node", default=None)
391 391
    iallocator = self._checkStringVariable("iallocator", default=None)
392
    early_r = bool(self._checkIntVariable("early_release", default=0))
393
    dry_run = bool(self.dryRun())
392 394

  
393
    op = opcodes.OpEvacuateNode(node_name=node_name,
394
                                remote_node=remote_node,
395
                                iallocator=iallocator)
395
    cl = baserlib.GetClient()
396 396

  
397
    return baserlib.SubmitJob([op])
397
    op = opcodes.OpNodeEvacuationStrategy(nodes=[node_name],
398
                                          iallocator=iallocator,
399
                                          remote_node=remote_node)
400

  
401
    job_id = baserlib.SubmitJob([op], cl)
402
    # we use custom feedback function, instead of print we log the status
403
    result = cli.PollJob(job_id, cl, feedback_fn=baserlib.FeedbackFn)
404

  
405
    jobs = []
406
    for iname, node in result:
407
      if dry_run:
408
        jid = None
409
      else:
410
        op = opcodes.OpReplaceDisks(instance_name=iname,
411
                                    remote_node=node, disks=[],
412
                                    mode=constants.REPLACE_DISK_CHG,
413
                                    early_release=early_r)
414
        jid = baserlib.SubmitJob([op])
415
      jobs.append((jid, iname, node))
416

  
417
    return jobs
398 418

  
399 419

  
400 420
class R_2_nodes_name_migrate(baserlib.R_Generic):

Also available in: Unified diff