diff options
author | Brent Eagles <beagles@redhat.com> | 2013-06-14 13:21:54 -0230 |
---|---|---|
committer | Brent Eagles <beagles@redhat.com> | 2013-06-25 11:33:27 -0230 |
commit | 8f3b3db9b04bb5ff7b9486dc6fc211745b983855 (patch) | |
tree | d25492d53a2f6b99daaa08f12e05d8f1c88dcbbd /nova/network/quantumv2/api.py | |
parent | 328b347cd058f1c87d7e32a18d9decc0ba517266 (diff) | |
download | nova-8f3b3db9b04bb5ff7b9486dc6fc211745b983855.tar.gz nova-8f3b3db9b04bb5ff7b9486dc6fc211745b983855.tar.xz nova-8f3b3db9b04bb5ff7b9486dc6fc211745b983855.zip |
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
Diffstat (limited to 'nova/network/quantumv2/api.py')
-rw-r--r-- | nova/network/quantumv2/api.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 = [] |