Revision d4d424fb lib/cmdlib/node.py

b/lib/cmdlib/node.py
857 857
  """
858 858
  REQ_BGL = False
859 859

  
860
  _MODE2IALLOCATOR = {
861
    constants.NODE_EVAC_PRI: constants.IALLOCATOR_NEVAC_PRI,
862
    constants.NODE_EVAC_SEC: constants.IALLOCATOR_NEVAC_SEC,
863
    constants.NODE_EVAC_ALL: constants.IALLOCATOR_NEVAC_ALL,
864
    }
865
  assert frozenset(_MODE2IALLOCATOR.keys()) == constants.NODE_EVAC_MODES
866
  assert (frozenset(_MODE2IALLOCATOR.values()) ==
867
          constants.IALLOCATOR_NEVAC_MODES)
868

  
869 860
  def CheckArguments(self):
870 861
    CheckIAllocatorOrNode(self, "iallocator", "remote_node")
871 862

  
......
1022 1013

  
1023 1014
    elif self.op.iallocator is not None:
1024 1015
      # TODO: Implement relocation to other group
1025
      evac_mode = self._MODE2IALLOCATOR[self.op.mode]
1026
      req = iallocator.IAReqNodeEvac(evac_mode=evac_mode,
1016
      req = iallocator.IAReqNodeEvac(evac_mode=self.op.mode,
1027 1017
                                     instances=list(self.instance_names))
1028 1018
      ial = iallocator.IAllocator(self.cfg, self.rpc, req)
1029 1019

  

Also available in: Unified diff