Don't encode to utf8 data read from logfile
In python3 all strings are stored as unicode in an instance of the str type. Encoded strings on the other hand are represented as binary data in the form of instances of the bytes type. In https://review.opendev.org/714280 we changed to not write in binary mode. Story: 2007449 Change-Id: I799c7cad76fd03ee45d3624feb5a7210f9ce8bf5
This commit is contained in:
parent
e7693eb1ae
commit
39a9e8aa15
|
@ -525,10 +525,7 @@ class TripleOValidatorRun(command.Command):
|
|||
contents = json.load(val)
|
||||
|
||||
for i in contents['plays']:
|
||||
host = [
|
||||
x.encode('utf-8')
|
||||
for x in i['play'].get('host').split(', ')
|
||||
]
|
||||
host = [x for x in i['play'].get('host').split(', ')]
|
||||
val_id = i['play'].get('validation_id')
|
||||
time_elapsed = \
|
||||
i['play']['duration'].get('time_elapsed', None)
|
||||
|
@ -542,8 +539,7 @@ class TripleOValidatorRun(command.Command):
|
|||
|
||||
unreachable_hosts = []
|
||||
hosts_result = []
|
||||
for h in list(contents['stats'].keys()):
|
||||
ht = h.encode('utf-8')
|
||||
for ht in list(contents['stats'].keys()):
|
||||
if contents['stats'][ht]['unreachable'] != 0:
|
||||
unreachable_hosts.append(ht)
|
||||
elif contents['stats'][ht]['failures'] != 0:
|
||||
|
|
Loading…
Reference in New Issue