From d6d8ba7bc9e795630cc4e035db2e25470f97e4e7 Mon Sep 17 00:00:00 2001 From: Yang Yu Date: Mon, 3 Jun 2013 18:12:10 +0800 Subject: Avoiding multiple code loops in filter scheduler The code snippet can not provide the original target. In the filters module, there is one line code will never be invoked because of the code logic, so I modified it. Fixes: bug 1186945 Change-Id: I3f2a662c28ab466b178268cae3502c40a1d22657 --- nova/filters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nova/filters.py b/nova/filters.py index 4b7f9ff10..e1f65658a 100644 --- a/nova/filters.py +++ b/nova/filters.py @@ -64,4 +64,6 @@ class BaseFilterHandler(loadables.BaseLoader): list_objs = list(objs) LOG.debug("Filter %(cls_name)s returned %(obj_len)d host(s)", {'cls_name': cls_name, 'obj_len': len(list_objs)}) + if len(list_objs) == 0: + break return list_objs -- cgit