From 775e98580d0b405f0da9bd8e3cfe062ee49aa4c1 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Thu, 25 Oct 2012 21:34:53 -0400 Subject: More robust checking for empty requested_networks It's possible that requested_networks will be empty but not None. Especially since novaclient defaults to an empty list. This avoids attempting an unnecessary validation. Change-Id: I131dbb3f6cc6167e150d4a46386e6b0b51035579 --- nova/compute/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 9611f0fff..a30715762 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -280,7 +280,7 @@ class API(base.Base): and the fixed IP address for each network provided is within same the network block """ - if requested_networks is None: + if not requested_networks: return self.network_api.validate_networks(context, requested_networks) -- cgit