summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/setools/boolquery.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/setools/boolquery.py')
-rwxr-xr-x[-rw-r--r--]lib/python2.7/site-packages/setools/boolquery.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/python2.7/site-packages/setools/boolquery.py b/lib/python2.7/site-packages/setools/boolquery.py
index b70b7d5..2e991c2 100644..100755
--- a/lib/python2.7/site-packages/setools/boolquery.py
+++ b/lib/python2.7/site-packages/setools/boolquery.py
@@ -18,11 +18,12 @@
#
import logging
-from . import compquery
from .descriptors import CriteriaDescriptor
+from .mixins import MatchName
+from .query import PolicyQuery
-class BoolQuery(compquery.ComponentQuery):
+class BoolQuery(MatchName, PolicyQuery):
"""Query SELinux policy Booleans.
@@ -50,10 +51,14 @@ class BoolQuery(compquery.ComponentQuery):
else:
self._default = bool(value)
+ def __init__(self, policy, **kwargs):
+ super(BoolQuery, self).__init__(policy, **kwargs)
+ self.log = logging.getLogger(__name__)
+
def results(self):
"""Generator which yields all Booleans matching the criteria."""
- self.log.info("Generating results from {0.policy}".format(self))
- self.log.debug("Name: {0.name!r}, regex: {0.name_regex}".format(self))
+ self.log.info("Generating Boolean results from {0.policy}".format(self))
+ self._match_name_debug(self.log)
self.log.debug("Default: {0.default}".format(self))
for boolean in self.policy.bools():