lava_rpc_connector.py: refactor get_job_log

Fix https://projects.linaro.org/browse/LSS-2002

target_log can be truncated when locales aren't installed.
To fix the issue, we install locales and set them to UTF-8.

In addition, we handle unicode (non-ascii) characters.
Refactor the code for this purpose and simplify the code.
The job log returned by LAVA is a YAML document, instead of looping and
loading each line of the document, load the YAML only once.
Then we can process and handle the message.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Change-Id: I1edc4de7e340f0752817d170aef0a74afe461f65
1 file changed