summaryrefslogtreecommitdiffstats
path: root/src/report-python/test_setroubleshoot_example2
blob: b712cda7b053e1b9dc567877aa731f737ce88b4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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_problem_data(signature, "report")

print "rc:", rc