summaryrefslogtreecommitdiffstats
path: root/src/report-python/test_setroubleshoot_example2
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2011-03-01 12:08:36 +0100
committerKarel Klic <kklic@redhat.com>2011-03-01 12:08:36 +0100
commit85f639b7fe277ba327e5013e5b101b4a67f14e1d (patch)
tree7caa3999e8c987e3ddbc26f4bfbbdc73defca73f /src/report-python/test_setroubleshoot_example2
parentfb52104af74bbf6eeda394880666df40b4354aba (diff)
parent77468fcdd7cc05db52320c373a24a5490ff32f52 (diff)
merge changes from master
Diffstat (limited to 'src/report-python/test_setroubleshoot_example2')
-rwxr-xr-xsrc/report-python/test_setroubleshoot_example227
1 files changed, 27 insertions, 0 deletions
diff --git a/src/report-python/test_setroubleshoot_example2 b/src/report-python/test_setroubleshoot_example2
new file mode 100755
index 00000000..8aebcdfe
--- /dev/null
+++ b/src/report-python/test_setroubleshoot_example2
@@ -0,0 +1,27 @@
+#!/usr/bin/python
+
+import report
+import report.io
+import report.io.GTKIO
+import report.accountmanager
+
+accounts = report.accountmanager.AccountManager()
+
+signature = report.createAlertSignature("selinux-policy",
+ "setroubleshoot",
+ "self.siginfo.get_hash()",
+ "self.summary",
+ "content")
+
+# Won't send log anywhere:
+#rc = report.report(signature, report.io.GTKIO.GTKIO(accounts))
+
+# report.report() + logging:
+def logging_callback(line):
+ print "LOG:", line
+ return
+state = report.run_event_state()
+state.logging_callback = logging_callback
+rc = state.run_event_on_crash_data(signature, "report")
+
+print "rc:", rc