From 62b705f2ef608e212229a234b9e53cf60f9dd83f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 26 Sep 2007 16:35:26 -0400 Subject: The addition of an example program to find which systems have parts subject to recall. --- examples/find_recalled_parts.py | 24 ++++++++++++++++++++++++ examples/part_data.txt | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 examples/find_recalled_parts.py create mode 100644 examples/part_data.txt (limited to 'examples') diff --git a/examples/find_recalled_parts.py b/examples/find_recalled_parts.py new file mode 100644 index 0000000..f9ca4bb --- /dev/null +++ b/examples/find_recalled_parts.py @@ -0,0 +1,24 @@ +#!/usr/bin/python +# find all parts that need to be recalled +# (C) Michael DeHaan, 2007 +# =============================================== + +import func.overlord.client as fc + +bad = open("./part_data.txt").read().split() + +info = fc.Client("*").hardware.info() + +for (host,details) in info.iteritems(): + + if type(details) != dict: + print "%s had an error : %s" % (host,str(details)) + break + + for device in details["devices"]: + for bad_value in bad: + if device["Description"].find(bad_value) != -1: + print "%s has flagged part: %s " % (host, device["Description"]) + break + + diff --git a/examples/part_data.txt b/examples/part_data.txt new file mode 100644 index 0000000..3d2cf3a --- /dev/null +++ b/examples/part_data.txt @@ -0,0 +1,12 @@ +#-BAD-ITEM-PARTS +92P1072 92P1073 92P1088 92P1089 92P1142 92P1141 92P1170", "92P1169", +93P5028 92P1174 92P1173 93P5030 + +#-BAD-DELL-PARTS +1K055 C5446 F2100 KD494 W5915 Y1333 3K590 C6269 F5132 OR33X5308 Y4500 5P474 +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 + -- cgit