From 5c306dd434db5ee209699f8a0ca8c3c0c65a19fc Mon Sep 17 00:00:00 2001 From: Jeff Lane Date: Tue, 10 Jan 2017 16:52:03 -0500 Subject: a few more output tweaks --- bin/dmitest | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/dmitest b/bin/dmitest index 18497dd..9be70be 100755 --- a/bin/dmitest +++ b/bin/dmitest @@ -238,6 +238,7 @@ def main(): help="Set to check serial number information") args = parser.parse_args() + bad_data = False # Command to retrieve DMI information COMMAND = "dmidecode" if args.dmifile: @@ -257,8 +258,11 @@ def main(): try: stream.append(line.decode('utf-8')) except UnicodeDecodeError as ude: - print("DATA ERROR: {} \n\t{}".format(ude, line)) + print("DATA ERROR: {}".format(ude)) + print("\tLINE NUMBER {}: {}".format(dmi_out.index(line) + 1, line)) stream.append("ERROR: BAD DATA FOUND HERE") + bad_data = True + if args.show_dmi: print("===== DMI Data Used: =====") for line in stream: @@ -289,6 +293,10 @@ def main(): else: print("\nPassed all tests") + if bad_data: + print("\nBad Characters discovered in DMI output. Rerun with " + "the --show_dmi option to see more") + return retval -- cgit v1.2.3