Permalink
Browse files

add some null checking to class loader

  • Loading branch information...
1 parent d26e204 commit ea5eb07f95ec9b372d3a23d0a252e47420b8b65b richard-jones committed Jan 15, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 sss/config.py
View
@@ -1,6 +1,7 @@
import os, uuid, sys, json
from ingesters_disseminators import DefaultEntryIngester, DefaultDisseminator, FeedDisseminator, BinaryIngester, SimpleZipIngester, METSDSpaceIngester
from negotiator import AcceptParameters, ContentType
+from core import SwordServer, Authenticator, WebUI
from sss_logging import logging
ssslog = logging.getLogger(__name__)
@@ -141,13 +142,22 @@ def __init__(self, config_file=None):
# the json string. How much does this matter?
def get_server_implementation(self):
- return self._get_class(self.sword_server)
+ if self.sword_server is not None:
+ return self._get_class(self.sword_server)
+ else:
+ return SwordServer
def get_authenticator_implementation(self):
- return self._get_class(self.authenticator)
+ if self.authenticator is not None:
+ return self._get_class(self.authenticator)
+ else:
+ return Authenticator
def get_webui_implementation(self):
- return self._get_class(self.webui)
+ if self.webui is not None:
+ return self._get_class(self.webui)
+ else:
+ return WebUI
def get_container_formats(self):
default_params = self._get_accept_params(self.container_format_default)

0 comments on commit ea5eb07

Please sign in to comment.