summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-20 11:51:04 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-20 11:51:04 -0400
commit46464991f12df8b9823ef913d18e0072c740ebbb (patch)
treee88ab301d304c3f493a454945037d53836fe2922 /src/lib/Bcfg2/Server/Plugins/Packages/Source.py
parentc5409b7cb6301b4ee8cf498328dbe8e04d234ca9 (diff)
downloadbcfg2-46464991f12df8b9823ef913d18e0072c740ebbb.tar.gz
bcfg2-46464991f12df8b9823ef913d18e0072c740ebbb.tar.bz2
bcfg2-46464991f12df8b9823ef913d18e0072c740ebbb.zip
Packages: fixed unknown_filter
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages/Source.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/Source.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
index 7188394b3..0e27f99f1 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py
@@ -111,14 +111,6 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
#: make sources of this type available to clients.
basegroups = []
- #: A predicate that is used by :func:`filter_unknown` to filter
- #: packages from the results of
- #: :func:`Bcfg2.Server.Plugins.Packages.Collection.Collection.complete`
- #: that should not be shown to the end user (i.e., that are not
- #: truly unknown, but are rather packaging system artifacts). By
- #: default, excludes any package whose name starts with "choice"
- unknown_filter = lambda p: p.startswith("choice")
-
#: The Package type handled by this Source class. The ``type``
#: attribute of Package entries will be set to the value ``ptype``
#: when they are handled by :mod:`Bcfg2.Server.Plugins.Packages`.
@@ -573,6 +565,21 @@ class Source(Bcfg2.Server.Plugin.Debuggable):
self.provides[barch][prov] = prov[barch].get(prov, ())
self.save_state()
+ def unknown_filter(self, package):
+ """ A predicate that is used by :func:`filter_unknown` to
+ filter packages from the results of
+ :func:`Bcfg2.Server.Plugins.Packages.Collection.Collection.complete`
+ that should not be shown to the end user (i.e., that are not
+ truly unknown, but are rather packaging system artifacts). By
+ default, excludes any package whose name starts with "choice"
+
+ :param package: The name of a package that was unknown to the
+ backend
+ :type package: string
+ :returns: bool
+ """
+ return package.startswith("choice")
+
def filter_unknown(self, unknown):
""" After
:func:`Bcfg2.Server.Plugins.Packages.Collection.Collection.complete`,