UnitSentry.file_contents() breaks for non-utf8 files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Amulet |
New
|
Undecided
|
Unassigned |
Bug Description
If you try to get a binary file using UnitSentry.
UnicodeDecodeError, since it always tried to decode the contents using UTF-8.
Traceback (most recent call last):
File "/usr/lib/
yield
File "/usr/lib/
testMethod()
File "/home/
haproxy_path + http_code + ".http", "haproxy/0"),
File "/home/
return unit_sentry.
File "/usr/lib/
output, return_code = self._run('cat {}'.format(
File "/usr/lib/
return output.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 72: invalid start byte
There should be a way to get binary files as well as text files.
tags: | added: landscape |