Skip to content

Commit

Permalink
Fix py3 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jul 28, 2020
1 parent 201161c commit ef14a4e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions IM/VirtualMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,9 @@ def get_ctxt_log(self, remote_dir, ssh, delete=False):
self.log_debug("Get File: " + remote_dir + '/ctxt_agent.log')
ssh.sftp_get(remote_dir + '/ctxt_agent.log', tmp_dir + '/ctxt_agent.log')
with open(tmp_dir + '/ctxt_agent.log') as f:
conf_out = f.read()

# Remove problematic chars
conf_out = str("".join(list(filter(lambda x: x in string.printable,
conf_out))).encode("ascii", "replace").decode("utf-8"))
# Read removing problematic chars
conf_out = str("".join(list(filter(lambda x: x in string.printable,
f.read()))).encode("ascii", "replace").decode("utf-8"))
try:
if delete:
ssh.sftp_remove(remote_dir + '/ctxt_agent.log')
Expand Down

0 comments on commit ef14a4e

Please sign in to comment.