summaryrefslogtreecommitdiff
path: root/bin
diff options
authorJeff Lane <jeffrey.lane@canonical.com>2017-01-10 16:52:03 -0500
committerJeff Lane <jeffrey.lane@canonical.com>2017-01-10 16:52:03 -0500
commit5c306dd434db5ee209699f8a0ca8c3c0c65a19fc (patch)
tree513c6b0b06fdfccbab978eb97233cd281ac07a8c /bin
parent113f91bb6d5e844b322d563436eeb6d466ebcf6b (diff)
a few more output tweaks
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dmitest10
1 files changed, 9 insertions, 1 deletions
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