# HG changeset patch # User Sylvain Thénault # Date 1288117308 -7200 # Node ID 72f2fd93a6225b2e45ca1200ffa7bd95467f3558 # Parent 29f8e5c353923496c8892b8791b12a1eb2a81a2b [ms planning] fix bug in merge_input_map causing bad plans computed diff -r 29f8e5c35392 -r 72f2fd93a622 server/msplanner.py --- a/server/msplanner.py Tue Oct 26 20:21:09 2010 +0200 +++ b/server/msplanner.py Tue Oct 26 20:21:48 2010 +0200 @@ -1108,14 +1108,17 @@ """ if not self._inputmaps: return [(allsolindices, None)] + _allsolindices = allsolindices.copy() mapbysol = {} # compute a single map for each solution for solindices, basemap in self._inputmaps.iteritems(): for solindex in solindices: + if not solindex in allsolindices: + continue solmap = mapbysol.setdefault(solindex, {}) solmap.update(basemap) try: - allsolindices.remove(solindex) + _allsolindices.remove(solindex) except KeyError: continue # already removed # group results by identical input map @@ -1127,8 +1130,8 @@ break else: result.append( ([solindex], solmap) ) - if allsolindices: - result.append( (list(allsolindices), None) ) + if _allsolindices: + result.append( (list(_allsolindices), None) ) return result def build_final_part(self, select, solindices, inputmap, sources,