diff --git a/bin/nova-manage b/bin/nova-manage index e581c8fd..fd978760 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -431,11 +431,17 @@ class FloatingIpCommands(object): pool = FLAGS.default_floating_pool if not interface: interface = FLAGS.public_interface - for address in self.address_to_hosts(ip_range): - db.floating_ip_create(admin_context, - {'address': str(address), - 'pool': pool, - 'interface': interface}) + + ips = ({'address': str(address), 'pool': pool, 'interface': interface} + for address in self.address_to_hosts(ip_range)) + try: + db.floating_ip_bulk_create(admin_context, ips) + except exception.FloatingIpExists as exc: + # NOTE(simplylizz): Maybe logging would be better here + # instead of printing, but logging isn't used here and I + # don't know why. + print('error: %s' % exc) + sys.exit(1) @args('--ip_range', dest="ip_range", metavar='', help='IP range') def delete(self, ip_range):