[TRAIN ONLY] Do not encode hostnames in validation result
Encoding the names to utf-8 leads to unwanted failures such as: KeyError: b'undercloud' as well as TypeError: sequence item 0: expected str instance, bytes found Removing the two calls to .encode() solves those issues. It also correct a tiny deprecation warning, moving from LOG.warn to LOG.warning. This is a train-only patch since later the whole thing was moved out of tripleoclient in favor of validations-libs and/or validations-common. Change-Id: Ie1530321b488bef11692553ea25131d9360763dd
This commit is contained in:
parent
0ba53608b2
commit
d58ea5bbb0
|
@ -547,8 +547,7 @@ class TripleOValidatorRun(command.Command):
|
|||
|
||||
for i in contents['plays']:
|
||||
host = [
|
||||
x.encode('utf-8')
|
||||
for x in i['play'].get('host').split(', ')
|
||||
x for x in i['play'].get('host').split(', ')
|
||||
]
|
||||
val_id = i['play'].get('validation_id')
|
||||
time_elapsed = \
|
||||
|
@ -563,8 +562,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:
|
||||
|
@ -592,8 +590,8 @@ class TripleOValidatorRun(command.Command):
|
|||
print(t)
|
||||
|
||||
if len(new_log_files) > len(results):
|
||||
LOG.warn(_('Looks like we have more log files than '
|
||||
'executed validations'))
|
||||
LOG.warning(_('Looks like we have more log files than '
|
||||
'executed validations'))
|
||||
|
||||
for i in new_log_files:
|
||||
os.rename(
|
||||
|
|
Loading…
Reference in New Issue