diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Packages/Collection.py | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/debian/changelog b/debian/changelog index 8791b7b41..b2d60915b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,13 @@ bcfg2 (1.2.3-11) UNRELEASED; urgency=low + * Plugins/Packages/Collection: add cclass marker for Sources * Plugins/Packages/Collection: add missing format string parameter * Client/Tools/APT: save new package version for auto pkgs * Plugins/Packages: backported get_new_packages * Plugins/Packages: backported packages_form_entry/_to_entry * Plugins/PkgVars: new plugin to set various vars per package - -- Alexander Sulfrian <alex@spline.inf.fu-berlin.de> Sun, 10 Mar 2013 22:23:12 +0100 + -- Alexander Sulfrian <alex@spline.inf.fu-berlin.de> Sun, 10 Mar 2013 22:28:57 +0100 bcfg2 (1.2.3-9) unstable; urgency=low diff --git a/src/lib/Server/Plugins/Packages/Collection.py b/src/lib/Server/Plugins/Packages/Collection.py index f417a6c54..2e5ff450b 100644 --- a/src/lib/Server/Plugins/Packages/Collection.py +++ b/src/lib/Server/Plugins/Packages/Collection.py @@ -374,12 +374,15 @@ def factory(metadata, sources, basepath, debug=False): for source in sources: if source.applies(metadata): relevant.append(source) - sclasses.update([source.__class__]) + if 'cclass' in dir(source): + sclasses.update([source.cclass]) + else: + sclass = source.__class__.__name__.replace("Source", "") + sclasses.update([sclass]) if len(sclasses) > 1: logger.warning("Packages: Multiple source types found for %s: %s" % - (metadata.hostname, - ", ".join([s.__name__ for s in sclasses]))) + (metadata.hostname, ", ".join(sclasses))) cclass = Collection elif len(sclasses) == 0: # you'd think this should be a warning, but it happens all the @@ -393,7 +396,7 @@ def factory(metadata, sources, basepath, debug=False): metadata.hostname) cclass = Collection else: - stype = sclasses.pop().__name__.replace("Source", "") + stype = sclasses.pop() try: module = \ getattr(__import__("Bcfg2.Server.Plugins.Packages.%s" % |