diff options
author | Yang Yu <yuyangbj@cn.ibm.com> | 2013-06-03 18:12:10 +0800 |
---|---|---|
committer | Yang Yu <yuyangbj@cn.ibm.com> | 2013-06-04 13:29:16 +0800 |
commit | d6d8ba7bc9e795630cc4e035db2e25470f97e4e7 (patch) | |
tree | 62e2b925a0148b6309e4c05edc1dd3c518d19530 /nova/filters.py | |
parent | 150051daef7b55f45359407804d571b02e440915 (diff) | |
download | nova-d6d8ba7bc9e795630cc4e035db2e25470f97e4e7.tar.gz |
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
Diffstat (limited to 'nova/filters.py')
-rw-r--r-- | nova/filters.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/filters.py b/nova/filters.py index 4b7f9ff102..e1f65658ae 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 |