Revision 539d65ba lib/rapi/client.py

b/lib/rapi/client.py
956 956
                              (GANETI_RAPI_VERSION, instance)), query, None)
957 957

  
958 958
  def ReplaceInstanceDisks(self, instance, disks=None, mode=REPLACE_DISK_AUTO,
959
                           remote_node=None, iallocator=None, dry_run=False):
959
                           remote_node=None, iallocator=None):
960 960
    """Replaces disks on an instance.
961 961

  
962 962
    @type instance: str
......
971 971
    @type iallocator: str or None
972 972
    @param iallocator: instance allocator plugin to use (for use with
973 973
                       replace_auto mode)
974
    @type dry_run: bool
975
    @param dry_run: whether to perform a dry run
976 974

  
977 975
    @rtype: string
978 976
    @return: job id
......
982 980
      ("mode", mode),
983 981
      ]
984 982

  
985
    if disks:
983
    # TODO: Convert to body parameters
984

  
985
    if disks is not None:
986 986
      query.append(("disks", ",".join(str(idx) for idx in disks)))
987 987

  
988
    if remote_node:
988
    if remote_node is not None:
989 989
      query.append(("remote_node", remote_node))
990 990

  
991
    if iallocator:
991
    if iallocator is not None:
992 992
      query.append(("iallocator", iallocator))
993 993

  
994
    if dry_run:
995
      query.append(("dry-run", 1))
996

  
997 994
    return self._SendRequest(HTTP_POST,
998 995
                             ("/%s/instances/%s/replace-disks" %
999 996
                              (GANETI_RAPI_VERSION, instance)), query, None)

Also available in: Unified diff