Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
javrasya committed Sep 1, 2015
1 parent b45547e commit 30142bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions river/handlers/backends/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def __register(self, handler_objs):
handlers = []
if handler_objs.exists():
for handler in handler_objs:
module, method = handler.method.rsplit('.', 1)
module, method_name = handler.method.rsplit('.', 1)
try:
method = getattr(__import__(module, fromlist=[method]), method, None)
if method:
self.handlers[handler.hash] = method
handlers.append(method)
LOGGER.debug("Handler '%s' from database is registered initially from database as method '%s' and module '%s'. " % (handler.hash, method.__name__, module))
LOGGER.debug("Handler '%s' from database is registered initially from database as method '%s' and module '%s'. " % (handler.hash, method_name, module))
else:
LOGGER.warning("Handler '%s' from database can not be registered. Because method '%s' is not in module '%s'. " % (handler.hash, method.__name__, module))
LOGGER.warning("Handler '%s' from database can not be registered. Because method '%s' is not in module '%s'. " % (handler.hash, method_name, module))
except ImportError:
LOGGER.warning("Handler '%s' from database can not be registered. Because module '%s' does not exists. " % (handler.hash, module))
return handlers
Expand Down

0 comments on commit 30142bb

Please sign in to comment.