summaryrefslogtreecommitdiffstats
path: root/plugins/plugin_examples/dep3.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2008-05-05 15:46:38 +0200
committerMartin Sivak <msivak@redhat.com>2008-05-05 15:46:38 +0200
commitdda25ee4e1ca17cd333f10fcf0c825b60105da9c (patch)
tree38b57154fda72b4d2bf07bced54c3fe9be7924b3 /plugins/plugin_examples/dep3.py
parentc227496fa86c36762018c2a8219f2136ec63fa10 (diff)
downloadfirstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.gz
firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.tar.xz
firstaidkit-dda25ee4e1ca17cd333f10fcf0c825b60105da9c.zip
Use Issue reporting in plugins
Diffstat (limited to 'plugins/plugin_examples/dep3.py')
-rw-r--r--plugins/plugin_examples/dep3.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/plugin_examples/dep3.py b/plugins/plugin_examples/dep3.py
index 3da70ea..fb109c4 100644
--- a/plugins/plugin_examples/dep3.py
+++ b/plugins/plugin_examples/dep3.py
@@ -17,6 +17,8 @@
from pyfirstaidkit.plugins import Plugin,Flow
from pyfirstaidkit.returns import *
+from pyfirstaidkit.reporting import PLUGIN
+from pyfirstaidkit.issue import SimpleIssue
class Sample1Plugin(Plugin):
"""This plugin uses the predefined flow in the Plugin abstract class."""
@@ -25,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(detected = False, reporting = self._reporting, origin = self, level = PLUGIN)
def backup(self):
self._result=ReturnSuccess
@@ -38,9 +42,11 @@ class Sample1Plugin(Plugin):
def diagnose(self):
self._result=ReturnSuccess
self.provide("sample_dependency")
+ self._issue.set(detected = True, happened = False, reporting = self._reporting, origin = self, level = PLUGIN)
def fix(self):
self._result=ReturnFailure
+ self._issue.set(fixed = False, reporting = self._reporting, origin = self, level = PLUGIN)
def clean(self):
self._result=ReturnSuccess