Revision d43a4dd9 lib/cmdlib/instance.py

b/lib/cmdlib/instance.py
207 207

  
208 208
      nic_ip = ip
209 209

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

  
215 210
    # MAC address verification
216 211
    mac = nic.get(constants.INIC_MAC, constants.VALUE_AUTO)
217 212
    if mac not in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
......
2630 2625
    elif new_mode == constants.NIC_MODE_ROUTED:
2631 2626
      ip = params.get(constants.INIC_IP, old_ip)
2632 2627
      if ip is None:
2633
        raise errors.OpPrereqError("Cannot set the NIC IP address to None"
2634
                                   " on a routed NIC", errors.ECODE_INVAL)
2628
        self.LogInfo("Allowing mode=routed, ip=None (can have an ip6)")
2635 2629

  
2636 2630
    elif new_mode == constants.NIC_MODE_OVS:
2637 2631
      # TODO: check OVS link

Also available in: Unified diff