Revision 2e1b72ee lib/cmdlib/instance.py

b/lib/cmdlib/instance.py
205 205

  
206 206
      nic_ip = ip
207 207

  
208
    # TODO: check the ip address for uniqueness
209
    if nic_mode == constants.NIC_MODE_ROUTED and not nic_ip:
210
      raise errors.OpPrereqError("Routed nic mode requires an ip address",
211
                                 errors.ECODE_INVAL)
212

  
213 208
    # MAC address verification
214 209
    mac = nic.get(constants.INIC_MAC, constants.VALUE_AUTO)
215 210
    if mac not in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
......
2523 2518

  
2524 2519
    elif new_mode == constants.NIC_MODE_ROUTED:
2525 2520
      ip = params.get(constants.INIC_IP, old_ip)
2526
      if ip is None:
2527
        raise errors.OpPrereqError("Cannot set the NIC IP address to None"
2528
                                   " on a routed NIC", errors.ECODE_INVAL)
2529 2521

  
2530 2522
    elif new_mode == constants.NIC_MODE_OVS:
2531 2523
      # TODO: check OVS link

Also available in: Unified diff