From 9dc548917aa5abd9b0a134e8d36c29e204ec9ee5 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 16 Jan 2013 09:37:39 +1300 Subject: [PATCH] Reject user ports that have MACs the hypervisor cannot use. If a hypervisor has requested specific MAC addresses, ports requested by the user have to be in that set of MAC addresses, or they cannot be used. Raising an error at network allocation time is cleaner than waiting for the hypervisor to attempt to plug its vifs and error. Change-Id: If556cc518a01df658044e3ba6b9d7584bfabe588 --- nova/exception.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nova/exception.py b/nova/exception.py index f96b1eaf3..b16bc7669 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -522,6 +522,10 @@ class PortNotFound(NotFound): message = _("Port %(port_id)s could not be found.") +class PortNotUsable(NovaException): + message = _("Port %(port_id)s not usable for instance %(instance)s.") + + class FixedIpNotFound(NotFound): message = _("No fixed IP associated with id %(id)s.")