Revision 46d2d8a2 lib/cmdlib.py

b/lib/cmdlib.py
236 236
_PMigrationMode = ("mode", None, _TOr(_TNone,
237 237
                                      _TElemOf(constants.HT_MIGRATION_MODES)))
238 238

  
239
#: the obsolete 'live' mode (boolean)
240
_PMigrationLive = ("live", None, _TMaybeBool)
241

  
239 242

  
240 243
# End types
241 244
class LogicalUnit(object):
......
5512 5515
  _OP_PARAMS = [
5513 5516
    _PInstanceName,
5514 5517
    _PMigrationMode,
5518
    _PMigrationLive,
5515 5519
    ("cleanup", False, _TBool),
5516 5520
    ]
5517 5521

  
......
5743 5747
  _OP_PARAMS = [
5744 5748
    _PNodeName,
5745 5749
    _PMigrationMode,
5750
    _PMigrationLive,
5746 5751
    ]
5747 5752
  REQ_BGL = False
5748 5753

  
......
5847 5852

  
5848 5853
    self.instance = instance
5849 5854

  
5850
    if self.lu.op.mode is None:
5855
    if self.lu.op.live is not None and self.lu.op.mode is not None:
5856
      raise errors.OpPrereqError("Only one of the 'live' and 'mode'"
5857
                                 " parameters are accepted",
5858
                                 errors.ECODE_INVAL)
5859
    if self.lu.op.live is not None:
5860
      if self.lu.op.live:
5861
        self.lu.op.mode = constants.HT_MIGRATION_LIVE
5862
      else:
5863
        self.lu.op.mode = constants.HT_MIGRATION_NONLIVE
5864
      # reset the 'live' parameter to None so that repeated
5865
      # invocations of CheckPrereq do not raise an exception
5866
      self.lu.op.live = None
5867
    elif self.lu.op.mode is None:
5851 5868
      # read the default value from the hypervisor
5852 5869
      i_hv = self.cfg.GetClusterInfo().FillHV(instance, skip_globals=False)
5853 5870
      self.lu.op.mode = i_hv[constants.HV_MIGRATION_MODE]

Also available in: Unified diff