ffdc: Convert telnet return data to ASCII string.
telnetlib return data as a binary list.
Convert return data to ASCII string for processing.
Test:
- Regression test to telnet servers.
Signed-off-by: Peter D Phan <peterp@us.ibm.com>
Change-Id: I3ed066556a026370ea2e4a641d64bea90f9c5124
diff --git a/ffdc/ffdc_collector.py b/ffdc/ffdc_collector.py
index ceb0c67..1711c71 100644
--- a/ffdc/ffdc_collector.py
+++ b/ffdc/ffdc_collector.py
@@ -389,7 +389,7 @@
+ self.ffdc_prefix
+ targ_file)
# Creates a new file
- with open(targ_file_with_path, 'wb') as fp:
+ with open(targ_file_with_path, 'w') as fp:
fp.write(result)
fp.close
telnet_files_saved.append(targ_file)
diff --git a/ffdc/lib/telnet_utility.py b/ffdc/lib/telnet_utility.py
index e2a3adf..4ffa98f 100644
--- a/ffdc/lib/telnet_utility.py
+++ b/ffdc/lib/telnet_utility.py
@@ -125,5 +125,5 @@
logging.error("\t\t ERROR %s " % msg)
- # Return binary data.
- return local_buffer
+ # Return ASCII string data with ending PROMPT stripped
+ return local_buffer.decode('ascii', 'ignore').replace('$ ', '\n')