summaryrefslogtreecommitdiffstats
path: root/examples/find_recalled_parts.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/find_recalled_parts.py')
-rw-r--r--examples/find_recalled_parts.py24
1 files changed, 24 insertions, 0 deletions
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 <mdehaan@redhat.com>
+# ===============================================
+
+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
+
+