ported tools/*.py scripts to python3
Change-Id: Ib8dcc8b0c77515f8a302ed5bf03dc8283f36414b
This commit is contained in:
parent
c0e31f1c32
commit
0601be1bfd
@ -25,7 +25,6 @@ import six
|
|||||||
import six.moves.urllib.request as urlreq
|
import six.moves.urllib.request as urlreq
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
# DEVSTACK_GATE_GRENADE is either unset if grenade is not running
|
# DEVSTACK_GATE_GRENADE is either unset if grenade is not running
|
||||||
# or a string describing what type of grenade run to perform.
|
# or a string describing what type of grenade run to perform.
|
||||||
is_grenade = os.environ.get('DEVSTACK_GATE_GRENADE') is not None
|
is_grenade = os.environ.get('DEVSTACK_GATE_GRENADE') is not None
|
||||||
@ -137,7 +136,7 @@ def main(opts):
|
|||||||
with open(WHITELIST_FILE) as stream:
|
with open(WHITELIST_FILE) as stream:
|
||||||
loaded = yaml.safe_load(stream)
|
loaded = yaml.safe_load(stream)
|
||||||
if loaded:
|
if loaded:
|
||||||
for (name, l) in loaded.iteritems():
|
for (name, l) in six.iteritems(loaded):
|
||||||
for w in l:
|
for w in l:
|
||||||
assert 'module' in w, 'no module in %s' % name
|
assert 'module' in w, 'no module in %s' % name
|
||||||
assert 'message' in w, 'no message in %s' % name
|
assert 'message' in w, 'no message in %s' % name
|
||||||
|
@ -126,8 +126,8 @@ they are found.
|
|||||||
|
|
||||||
|
|
||||||
def print_stats(items, fname, verbose=False):
|
def print_stats(items, fname, verbose=False):
|
||||||
errors = len(filter(lambda x: x.level == "ERROR", items))
|
errors = len([x for x in items if x.level == "ERROR"])
|
||||||
traces = len(filter(lambda x: x.level == "TRACE", items))
|
traces = len([x for x in items if x.level == "TRACE"])
|
||||||
print("%d ERRORS found in %s" % (errors, fname))
|
print("%d ERRORS found in %s" % (errors, fname))
|
||||||
print("%d TRACES found in %s" % (traces, fname))
|
print("%d TRACES found in %s" % (traces, fname))
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ r = requests.get(url)
|
|||||||
# json library won't choke.
|
# json library won't choke.
|
||||||
projects = sorted(filter(is_in_openstack_namespace, json.loads(r.text[4:])))
|
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/".
|
# Every element of the found_plugins list begins with "openstack/".
|
||||||
# We drop those initial 10 octets when printing the list.
|
# We drop those initial 10 octets when printing the list.
|
||||||
|
Loading…
Reference in New Issue
Block a user