BF: (python 2.[45]) store backends names in a list to use .index later on (Closes gh-83)

.index() got into tuple's API only in 2.6
This commit is contained in:
Yaroslav Halchenko 2012-11-01 15:34:20 -04:00
parent 9510619b7b
commit 5becaf8ef2
3 changed files with 12 additions and 1 deletions

View file

@ -33,7 +33,9 @@ logSys = logging.getLogger("fail2ban.jail")
class Jail:
#Known backends. Each backend should have corresponding __initBackend method
_BACKENDS = ('pyinotify', 'gamin', 'polling')
# yoh: stored in a list instead of a tuple since only
# list had .index until 2.6
_BACKENDS = ['pyinotify', 'gamin', 'polling']
def __init__(self, name, backend = "auto"):
self.__name = name