summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Yu <yuyangbj@cn.ibm.com>2013-06-03 18:12:10 +0800
committerYang Yu <yuyangbj@cn.ibm.com>2013-06-04 13:29:16 +0800
commitd6d8ba7bc9e795630cc4e035db2e25470f97e4e7 (patch)
tree62e2b925a0148b6309e4c05edc1dd3c518d19530
parent150051daef7b55f45359407804d571b02e440915 (diff)
downloadnova-d6d8ba7bc9e795630cc4e035db2e25470f97e4e7.tar.gz
nova-d6d8ba7bc9e795630cc4e035db2e25470f97e4e7.tar.xz
nova-d6d8ba7bc9e795630cc4e035db2e25470f97e4e7.zip
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
-rw-r--r--nova/filters.py2
1 files changed, 2 insertions, 0 deletions
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