diff options
author | Martin Sivak <msivak@redhat.com> | 2008-05-05 15:46:38 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-05-05 15:46:38 +0200 |
commit | dda25ee4e1ca17cd333f10fcf0c825b60105da9c (patch) | |
tree | 38b57154fda72b4d2bf07bced54c3fe9be7924b3 /plugins/plugin_examples/sample1Plugin.py | |
parent | c227496fa86c36762018c2a8219f2136ec63fa10 (diff) | |
download | firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.gz firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.xz firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.zip |
Use Issue reporting in plugins
Diffstat (limited to 'plugins/plugin_examples/sample1Plugin.py')
-rw-r--r-- | plugins/plugin_examples/sample1Plugin.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/plugin_examples/sample1Plugin.py b/plugins/plugin_examples/sample1Plugin.py index 90e9874..560f69d 100644 --- a/plugins/plugin_examples/sample1Plugin.py +++ b/plugins/plugin_examples/sample1Plugin.py @@ -18,7 +18,7 @@ from pyfirstaidkit.plugins import Plugin,Flow from pyfirstaidkit.reporting import PLUGIN from pyfirstaidkit.returns import * - +from pyfirstaidkit.issue import SimpleIssue class Sample1Plugin(Plugin): """This plugin uses the predefined flow in the Plugin abstract class.""" @@ -27,9 +27,11 @@ class Sample1Plugin(Plugin): author = "Joel Andres Granados" def __init__(self, *args, **kwargs): Plugin.__init__(self, *args, **kwargs) + self._issue = SimpleIssue(self.name, self.description) def prepare(self): self._result=ReturnSuccess + self._issue.set(reporting = self._reporting, origin = self, level = PLUGIN) self._reporting.info("Sample1Plugin in Prepare task", origin = self, level = PLUGIN) def backup(self): @@ -42,10 +44,12 @@ class Sample1Plugin(Plugin): def diagnose(self): self._result=ReturnSuccess + self._issue.set(detected = True, happened = False, reporting = self._reporting, origin = self, level = PLUGIN) self._reporting.info("Sample1Plugin in diagnose task", origin = self, level = PLUGIN) def fix(self): self._result=ReturnFailure + self._issue.set(fixed = False, reporting = self._reporting, origin = self, level = PLUGIN) self._reporting.info("Sample1Plugin in Fix task", origin = self, level = PLUGIN) def clean(self): |