summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages/Collection.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugins/Packages/Collection.py')
-rw-r--r--src/lib/Server/Plugins/Packages/Collection.py11
1 files changed, 7 insertions, 4 deletions
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" %