Revision 34f9be6d

b/lib/cmdlib.py
10015 10015
          if nic.ip.lower() == constants.NIC_IP_POOL:
10016 10016
            try:
10017 10017
              nic.ip = self.cfg.GenerateIp(net, self.proc.GetECId())
10018
            except errors.ConfigurationError:
10018
            except errors.ReservationError:
10019 10019
              raise errors.OpPrereqError("Unable to get a free IP for NIC %d"
10020 10020
                                         " from the address pool" % idx,
10021 10021
                                         errors.ECODE_STATE)
......
12526 12526
          if new_ip.lower() == constants.NIC_IP_POOL:
12527 12527
            try:
12528 12528
              new_ip = self.cfg.GenerateIp(new_net, self.proc.GetECId())
12529
            except errors.ConfigurationError:
12529
            except errors.ReservationError:
12530 12530
              raise errors.OpPrereqError("Unable to get a free IP"
12531 12531
                                        " from the address pool",
12532 12532
                                         errors.ECODE_STATE)
b/lib/config.py
371 371
      try:
372 372
        ip = gen_free()
373 373
      except StopIteration:
374
        return None
374
        raise errors.ReservationError("Cannot generate IP. Network is full")
375 375
      return ("reserve", ip, net_uuid)
376 376

  
377 377
    _ ,address, _ = self._temporary_ips.Generate([], gen_one, ec_id)

Also available in: Unified diff