summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/setools/polcapquery.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/setools/polcapquery.py')
-rwxr-xr-x[-rw-r--r--]lib/python2.7/site-packages/setools/polcapquery.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/python2.7/site-packages/setools/polcapquery.py b/lib/python2.7/site-packages/setools/polcapquery.py
index e024b05..34ca769 100644..100755
--- a/lib/python2.7/site-packages/setools/polcapquery.py
+++ b/lib/python2.7/site-packages/setools/polcapquery.py
@@ -18,10 +18,11 @@
#
import logging
-from . import compquery
+from .mixins import MatchName
+from .query import PolicyQuery
-class PolCapQuery(compquery.ComponentQuery):
+class PolCapQuery(MatchName, PolicyQuery):
"""
Query SELinux policy capabilities
@@ -35,10 +36,14 @@ class PolCapQuery(compquery.ComponentQuery):
be used for matching the name.
"""
+ def __init__(self, policy, **kwargs):
+ super(PolCapQuery, self).__init__(policy, **kwargs)
+ self.log = logging.getLogger(__name__)
+
def results(self):
"""Generator which yields all matching policy capabilities."""
- 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 policy capability results from {0.policy}".format(self))
+ self._match_name_debug(self.log)
for cap in self.policy.polcaps():
if not self._match_name(cap):