X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestMapper.py;h=f07ed1b0b3674bc941266b0c49907daaefa03ace;hb=eeba8e303edbfc5e926767ba22294beda642ecba;hp=9a8ea679be26d80544d8a32e63b0cdd88019d4a7;hpb=c8e2f4e3a327181b29521583770a6f0ff68ca6eb;p=tests.git diff --git a/system/TestMapper.py b/system/TestMapper.py index 9a8ea67..f07ed1b 100644 --- a/system/TestMapper.py +++ b/system/TestMapper.py @@ -39,13 +39,13 @@ class TestMapper: if self.options.verbose: utils.header("TestMapper/{} : applying rules '{}' on {}"\ .format(type, map_pattern, name)) - for (k,v) in rename_dict.iteritems(): + for (k,v) in rename_dict.items(): # apply : separator path = k.split(':') # step down but last step in path o = obj for step in path[:-1]: - if not o.has_key(step): + if step not in o: o[step] = {} if self.options.verbose: utils.header ("WARNING : created step {} in path {} on {} {}"\ @@ -54,18 +54,18 @@ class TestMapper: # last step is the one for side-effect step = path[-1] if self.options.verbose: - if not o.has_key(step): + if step not in o: utils.header ("WARNING : inserting key {} for path {} on {} {}"\ .format(step, path, type, name)) # apply formatting if '%s' found in the value if v is None: - if self.options.verbose: print "TestMapper WARNING - None value - ignored, key=",k + if self.options.verbose: print("TestMapper WARNING - None value - ignored, key=",k) continue if v.find('%s') >= 0: v = v % obj[k] if self.options.verbose: - print("TestMapper, rewriting {}: {} into {}"\ - .format(name, k, v)) + print(("TestMapper, rewriting {}: {} into {}"\ + .format(name, k, v))) o[step] = v # only apply first rule return