Merge pull request #29 from leeclemens/enh/pyinotify

BF: Fixed and added error message if no backends initialized...
pull/27/merge
Yaroslav Halchenko 2012-01-12 20:08:49 -08:00
commit 35e9f6e464
1 changed files with 7 additions and 2 deletions

View File

@ -49,8 +49,10 @@ class Jail:
if backend != 'auto':
# we have got strict specification of the backend to use
if not (backend in self._BACKENDS):
logSys.error("Unknown backend %s. Must be among %s or 'auto'"
% (backend, backends))
raise ValueError("Unknown backend %s. Must be among %s or 'auto'"
% (backend, backends))
% (backend, backends))
# so explore starting from it till the 'end'
backends = backends[backends.index(backend):]
@ -68,8 +70,11 @@ class Jail:
except ImportError, e:
logSys.debug(
"Backend %r failed to initialize due to %s" % (b, e))
# log error since runtime error message isn't printed, INVALID COMMAND
logSys.error(
"Failed to initialize any backend for Jail %r" % self.__name)
raise RuntimeError(
"We should have initialized at least 'polling' backend")
"Failed to initialize any backend for Jail %r" % self.__name)
def _initPolling(self):