Revision 52194140

b/lib/rapi/rlib2.py
1 1
#
2 2
#
3 3

  
4
# Copyright (C) 2006, 2007, 2008 Google Inc.
4
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
426 426

  
427 427
    """
428 428
    node_name = self.items[0]
429
    live = bool(self._checkIntVariable("live", default=1))
430 429

  
431
    op = opcodes.OpMigrateNode(node_name=node_name, live=live)
430
    if "live" in self.queryargs and "mode" in self.queryargs:
431
      raise http.HttpBadRequest("Only one of 'live' and 'mode' should"
432
                                " be passed")
433
    elif "live" in self.queryargs:
434
      if self._checkIntVariable("live", default=1):
435
        mode = constants.HT_MIGRATION_LIVE
436
      else:
437
        mode = constants.HT_MIGRATION_NONLIVE
438
    else:
439
      mode = self._checkStringVariable("mode", default=None)
440

  
441
    op = opcodes.OpMigrateNode(node_name=node_name, mode=mode)
432 442

  
433 443
    return baserlib.SubmitJob([op])
434 444

  

Also available in: Unified diff