From 89e13567a64d63163ca622fb8e45be5f3ca6d443 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Fri, 27 Feb 2009 11:56:20 -0500 Subject: [PATCH] Add "reusable" column for nics, to avoid reusing addresses that are special in some way. svn path=/trunk/packages/invirt-web/; revision=2211 --- code/controls.py | 2 +- debian/changelog | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/controls.py b/code/controls.py index 4cd0e9c..911c41a 100644 --- a/code/controls.py +++ b/code/controls.py @@ -96,7 +96,7 @@ def createVm(username, state, owner, contact, name, description, memory, disksiz session.save_or_update(machine) disk = Disk(machine=machine, guest_device_name='hda', size=disksize) - nic = NIC.query().filter_by(machine_id=None).first() + nic = NIC.query().filter_by(machine_id=None).filter_by(reusable=True).first() if not nic: #No IPs left! raise CodeError("No IP addresses left! " "Contact %s." % config.web.errormail) diff --git a/debian/changelog b/debian/changelog index 024ce1d..26fd5c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.0.21) unstable; urgency=low + + * Don't reuse IP addresses that are special in some way. + + -- Quentin Smith Fri, 27 Feb 2009 11:55:51 -0500 + invirt-web (0.0.20) unstable; urgency=low * Don't confuse MB with MiB, or GB with GiB. -- 1.7.9.5