summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/FLAGS7
-rw-r--r--pyfirstaidkit/plugins.py11
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/FLAGS b/doc/FLAGS
index 0c6929c..cb573d6 100644
--- a/doc/FLAGS
+++ b/doc/FLAGS
@@ -56,3 +56,10 @@ network_dns
network_firewall
Part of network configuration was checked and appears OK
+rpm
+rpm_consistent
+ RPM database is in OK state and contains the right information
+rpm_lowlevel
+ RPM database has all required files and databases working
+
+
diff --git a/pyfirstaidkit/plugins.py b/pyfirstaidkit/plugins.py
index 05464fe..9b25c7f 100644
--- a/pyfirstaidkit/plugins.py
+++ b/pyfirstaidkit/plugins.py
@@ -297,6 +297,7 @@ class IssuesPlugin(Plugin):
Just fill the issue_tests list with classes describing the tests and let it run."""
issue_tests = [] #List of Issue classes to check
+ set_flags = [] #flags to set when everything is OK
def __init__(self, *args, **kwargs):
Plugin.__init__(self, *args, **kwargs)
@@ -321,6 +322,8 @@ Just fill the issue_tests list with classes describing the tests and let it run.
if result:
self._result=ReturnSuccess
+ for flag in self.set_flags:
+ self._dependencies.provide(flag)
else:
self._result=ReturnFailure
@@ -328,9 +331,17 @@ Just fill the issue_tests list with classes describing the tests and let it run.
"""Try to fix whatever is wrong in the system."""
result = False
+ fixed = True
for i in self.tests:
self._reporting.info(level = TASK, origin = self, message = "Fixing '%s'" % (i.name,))
result = result or i.fix()
+ i.reset()
+ if not i.detect() or i.happened():
+ fixed = False
+
+ if fixed:
+ for flag in self.set_flags:
+ self._dependencies.provide(flag)
if result:
self._result=ReturnSuccess