Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] fix slave id representation in logs #9676

Merged
merged 3 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions cfme/fixtures/parallelizer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class SlaveDetail(object):

appliance = attr.ib()
worker_config = attr.ib()
id = attr.ib(default=attr.Factory(lambda: next(SlaveDetail.slaveid_generator)))
id = attr.ib(default=attr.Factory(lambda: next(SlaveDetail.slaveid_generator)),
repr=lambda value: value.decode('utf-8'))
john-dupuy marked this conversation as resolved.
Show resolved Hide resolved
forbid_restart = attr.ib(default=False, init=False)
tests = attr.ib(default=attr.Factory(set), repr=False)
process = attr.ib(default=None, repr=False)
Expand Down Expand Up @@ -290,6 +291,7 @@ def monitor_shutdown(self, slave):

def _monitor_shutdown_t(self, slaveid, process):
# a KeyError here means self.slaves got mangled, indicating a problem elsewhere
slaveid = slaveid.decode('utf-8') if isinstance(slaveid, bytes) else slaveid
if process is None:
self.log.warning('Slave was missing when trying to monitor shutdown')

Expand Down Expand Up @@ -360,7 +362,7 @@ def send_tests(self, slave):
test_perc = self.sent_tests * 100 / collect_len
self.print_message(
f'sent {tests_len} tests '
f'to {slave.id} \n'
f'to {slave.id.decode("utf-8") if isinstance(slave.id, bytes) else slave.id} \n'
f'Total sent: {self.sent_tests} of {collect_len}, ({test_perc:.1f}%)'
)
return tests
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ appdirs==1.4.3
asn1crypto==0.24.0
aspy.yaml==1.3.0
atomicwrites==1.3.0
attrs==19.1.0
attrs==19.3.0
azure==4.0.0
azure-applicationinsights==0.1.0
azure-batch==4.1.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/frozen_docs.py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ anytree==2.6.0
appdirs==1.4.3
asn1crypto==0.24.0
atomicwrites==1.3.0
attrs==19.1.0
attrs==19.3.0
azure==4.0.0
azure-applicationinsights==0.1.0
azure-batch==4.1.3
Expand Down