Directly using base64 encoding for injected files

Binary files cannot be treated as utf-8 byte streams and converted
to plain. Change this back to just using base64 encoding as it was
before commit 8b264fc61d21fe4d0c7405914fb084f898956888.

Change-Id: I4ef6142676022b2e2f3178e7bfa24ed985fcae2c
Closes-Bug: #1408088
This commit is contained in:
Liang Chen 2015-01-07 13:23:10 -05:00
parent bda83f92d1
commit f75ea86a2a

@ -505,7 +505,9 @@ class ServerManager(base.BootingManagerWithFind):
else:
data = file_or_string
cont = base64.b64encode(data.encode('utf-8')).decode('utf-8')
if six.PY3 and isinstance(data, str):
data = data.encode('utf-8')
cont = base64.b64encode(data).decode('utf-8')
personality.append({
'path': filepath,
'contents': cont,