diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-26 17:26:03 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-09-26 17:26:03 -0400 |
commit | c6935aeff23ccd02d4f236dedf86f108c4df853b (patch) | |
tree | 2f54c48c0e84d37a498c09a7275a9f9fb4ce528c /examples | |
parent | 484c9dba767b8a9b1e907d5e4179951ca3f1f2f7 (diff) | |
download | third_party-func-c6935aeff23ccd02d4f236dedf86f108c4df853b.tar.gz third_party-func-c6935aeff23ccd02d4f236dedf86f108c4df853b.tar.xz third_party-func-c6935aeff23ccd02d4f236dedf86f108c4df853b.zip |
Refine the bad hardware checker -- this time it detects my potentially exploding (but now ruled safe)
battery correctly.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/find_recalled_parts.py | 12 | ||||
-rw-r--r-- | examples/part_data.txt | 4 |
2 files changed, 7 insertions, 9 deletions
diff --git a/examples/find_recalled_parts.py b/examples/find_recalled_parts.py index f9ca4bb..fc1a3b1 100644 --- a/examples/find_recalled_parts.py +++ b/examples/find_recalled_parts.py @@ -7,7 +7,7 @@ import func.overlord.client as fc bad = open("./part_data.txt").read().split() -info = fc.Client("*").hardware.info() +info = fc.Client("*").hardware.hal_info() for (host,details) in info.iteritems(): @@ -15,10 +15,10 @@ for (host,details) in info.iteritems(): print "%s had an error : %s" % (host,str(details)) break - for device in details["devices"]: + for (device, full_output) in details.iteritems(): for bad_value in bad: - if device["Description"].find(bad_value) != -1: - print "%s has flagged part: %s " % (host, device["Description"]) - break - + if full_output.find(bad_value) != -1: + print "%s has flagged part: %s, matched %s" % (host, device, bad_value) + break + diff --git a/examples/part_data.txt b/examples/part_data.txt index 3d2cf3a..ad888d9 100644 --- a/examples/part_data.txt +++ b/examples/part_data.txt @@ -7,6 +7,4 @@ C6270 GD785 M3006 X5329 Y5466 6P922 D2961 H3191 RD857 X5332 C2603 D5555 J1524 TD349 X5333 C5339 D6024 JD616 U5867 X5875 C5340 D6025 JD617 U5882 X5877 -#-RANDOM-STUFF-SO-GET-A-FALSE-POSITIVE -SCSI - +#-RANDOM-STUFF-IF-YOU-NEED-A-FALSE-POSITIVE-LIKE-MAYBE-SCSI |