diff options
author | Martin Sivak <msivak@redhat.com> | 2008-04-22 18:07:55 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-04-22 18:07:55 +0200 |
commit | d9a16bf880cc2e160cc5d0b2623becbe8807d704 (patch) | |
tree | 5fd99a82f7c6d5740635f3d6c40e81ed020a0bdf /pyfirstaidkit/plugins.py | |
parent | 0c003591bbc305977924099ad813eb2723cb657d (diff) | |
download | firstaidkit-d9a16bf880cc2e160cc5d0b2623becbe8807d704.tar.gz firstaidkit-d9a16bf880cc2e160cc5d0b2623becbe8807d704.tar.xz firstaidkit-d9a16bf880cc2e160cc5d0b2623becbe8807d704.zip |
Add ISSUE message to reporting and create SimpleIssue as a parent for Issue class (so everybody can use something simple to report state)
Diffstat (limited to 'pyfirstaidkit/plugins.py')
-rw-r--r-- | pyfirstaidkit/plugins.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py index 6bef7da..73d1da4 100644 --- a/pyfirstaidkit/plugins.py +++ b/pyfirstaidkit/plugins.py @@ -316,7 +316,9 @@ Just fill the issue_tests list with classes describing the tests and let it run. """Prepare the issues list""" for i in self.issue_tests: self._reporting.info(level = TASK, origin = self, message = "Preparing tests for '%s'" % (i.name,)) - self.tests.append(i(plugin = self)) + issue = i(plugin = self) + self.tests.append(issue) + self._reporting.issue(level = TASK, origin = self, issue = issue) self._result=ReturnSuccess def diagnose(self): @@ -327,6 +329,7 @@ Just fill the issue_tests list with classes describing the tests and let it run. for i in self.tests: self._reporting.info(level = TASK, origin = self, message = "Investigating '%s'" % (i.name,)) result = result or i.detect() + self._reporting.issue(level = TASK, origin = self, issue = i) if i.happened(): happened = True self._reporting.info(level = TASK, origin = self, message = i.str()) @@ -348,12 +351,14 @@ Just fill the issue_tests list with classes describing the tests and let it run. for i in self.tests: self._reporting.info(level = TASK, origin = self, message = "Fixing '%s'" % (i.name,)) result = result or i.fix() + self._reporting.issue(level = TASK, origin = self, issue = i) if not i.fixed(): fixed = False continue i.reset() if not i.detect() or i.happened(): + self._reporting.issue(level = TASK, origin = self, issue = i) fixed = False if result and fixed: |