It eases backporting in iruya and hunter as a few logs can't be
decoded as ascii [1].
[1] https://build.opnfv.org/ci/job/functest-opnfv-functest-vnf-iruya-juju_epc-run/56/console
Change-Id: I09c793469bdf4a679e6ed5a268e705efa5f2a20f
Signed-off-by: Cédric Ollivier <ollivier.cedric@gmail.com>
stderr=subprocess.STDOUT)
for line in iter(process.stdout.readline, b''):
if console:
stderr=subprocess.STDOUT)
for line in iter(process.stdout.readline, b''):
if console:
- sys.stdout.write(line.decode())
- f_stdout.write(line.decode())
+ sys.stdout.write(line.decode("utf-8"))
+ f_stdout.write(line.decode("utf-8"))
process.wait()
with open(self.result_file, 'r') as f_stdin:
self.__logger.debug("$ %s\n%s", cmd, f_stdin.read().rstrip())
process.wait()
with open(self.result_file, 'r') as f_stdin:
self.__logger.debug("$ %s\n%s", cmd, f_stdin.read().rstrip())
stats = subprocess.Popen(
['subunit-stats'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
stats = subprocess.Popen(
['subunit-stats'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
- cls.__logger.info("\n\n%s", output.decode())
+ cls.__logger.info("\n\n%s", output.decode("utf-8"))
def generate_xunit(self, stream):
"""Generate junit report from subunit stream
def generate_xunit(self, stream):
"""Generate junit report from subunit stream
['subunit2junitxml'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
['subunit2junitxml'], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
output, _ = stats.communicate(stream.read())
- xml.write(output.decode())
+ xml.write(output.decode("utf-8"))
def generate_html(self, stream):
"""Generate html report from subunit stream
def generate_html(self, stream):
"""Generate html report from subunit stream