From 8f3b3db9b04bb5ff7b9486dc6fc211745b983855 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Fri, 14 Jun 2013 13:21:54 -0230 Subject: Skip security group code when there is no network. This patch adds a simple check to the nova/quantum API that immediately returns an empty list if there are no configured networks available. Fixes bug 1191044 Change-Id: I34ac4dd56c71f99c7ed9ff632d6dc7036d91008d --- nova/network/quantumv2/api.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nova/network/quantumv2/api.py') diff --git a/nova/network/quantumv2/api.py b/nova/network/quantumv2/api.py index 054611cd3..e28d86b0e 100644 --- a/nova/network/quantumv2/api.py +++ b/nova/network/quantumv2/api.py @@ -184,6 +184,11 @@ class API(base.Base): nets = self._get_available_networks(context, instance['project_id'], net_ids) + + if not nets: + LOG.warn(_("No network configured!"), instance=instance) + return [] + security_groups = kwargs.get('security_groups', []) security_group_ids = [] -- cgit