diff --git a/tools/check_logs.py b/tools/check_logs.py index f82b387c0c..fc21f755d0 100755 --- a/tools/check_logs.py +++ b/tools/check_logs.py @@ -25,7 +25,6 @@ import six import six.moves.urllib.request as urlreq import yaml - # DEVSTACK_GATE_GRENADE is either unset if grenade is not running # or a string describing what type of grenade run to perform. is_grenade = os.environ.get('DEVSTACK_GATE_GRENADE') is not None @@ -137,7 +136,7 @@ def main(opts): with open(WHITELIST_FILE) as stream: loaded = yaml.safe_load(stream) if loaded: - for (name, l) in loaded.iteritems(): + for (name, l) in six.iteritems(loaded): for w in l: assert 'module' in w, 'no module in %s' % name assert 'message' in w, 'no message in %s' % name diff --git a/tools/find_stack_traces.py b/tools/find_stack_traces.py index 2ba8b164e5..1f2b88b441 100755 --- a/tools/find_stack_traces.py +++ b/tools/find_stack_traces.py @@ -126,8 +126,8 @@ they are found. def print_stats(items, fname, verbose=False): - errors = len(filter(lambda x: x.level == "ERROR", items)) - traces = len(filter(lambda x: x.level == "TRACE", items)) + errors = len([x for x in items if x.level == "ERROR"]) + traces = len([x for x in items if x.level == "TRACE"]) print("%d ERRORS found in %s" % (errors, fname)) print("%d TRACES found in %s" % (traces, fname)) diff --git a/tools/generate-tempest-plugins-list.py b/tools/generate-tempest-plugins-list.py index acb29af9ed..8d26c258f3 100644 --- a/tools/generate-tempest-plugins-list.py +++ b/tools/generate-tempest-plugins-list.py @@ -65,7 +65,7 @@ r = requests.get(url) # json library won't choke. projects = sorted(filter(is_in_openstack_namespace, json.loads(r.text[4:]))) -found_plugins = filter(has_tempest_plugin, projects) +found_plugins = list(filter(has_tempest_plugin, projects)) # Every element of the found_plugins list begins with "openstack/". # We drop those initial 10 octets when printing the list.