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/xserver.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/xserver.py')
-rw-r--r-- | plugins/xserver.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/xserver.py b/plugins/xserver.py index 8b63113..0b2f238 100644 --- a/plugins/xserver.py +++ b/plugins/xserver.py @@ -19,6 +19,7 @@ from pyfirstaidkit.plugins import Plugin,Flow from pyfirstaidkit.returns import * from pyfirstaidkit.utils import * from pyfirstaidkit.reporting import PLUGIN +from pyfirstaidkit.issue import SimpleIssue from pyfirstaidkit import Config import rhpxl.xserver @@ -42,10 +43,12 @@ class Xserver(Plugin): # Arbitrary test display self.display = ":10" self.confPath = "/etc/X11/xorg.conf" + self._issue = SimpleIssue(self.name, "X server didn't start") def prepare(self): # Nothing to prepare really. self._result = ReturnSuccess + self._issue.set(reporting = self._reporting, level = PLUGIN, origin = self) # If we cant start the server def diagnose(self): @@ -55,6 +58,7 @@ class Xserver(Plugin): else: self._reporting.info("X server is missconfigured.", level = PLUGIN, origin = self) self._result = ReturnFailure + self._issue.set(detected = True, happened = (self._result == ReturnFailure), reporting = self._reporting, level = PLUGIN, origin = self) # FIXME:Must change this when the backup utils is done. def backup(self): @@ -89,6 +93,7 @@ class Xserver(Plugin): else: self._reporting.info("X server is still missconfigured with new file.", level = PLUGIN, origin = self) self._result = ReturnFailure + self._issue.set(fixed = (self._result == ReturnSuccess), reporting = self._reporting, level = PLUGIN, origin = self) def restore(self): if os.path.isfile("%s.FAK-backup"%self.confPath): |