%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/fail2ban/server/ |
Current File : //usr/lib/python2.7/site-packages/fail2ban/server/jails.pyc |
� ��&dc @ sr d Z d Z d Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d e f d � � YZ d S( s! Cyril Jaquier, Yaroslav Halchenkos: Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenkot GPLi����( t Lock( t Mappingi ( t DuplicateJailExceptiont UnknownJailExceptioni ( t Jailt Jailsc B sP e Z d Z d � Z d d � Z d � Z d � Z d � Z d � Z d � Z RS( sB Handles the jails. This class handles the jails. Creation, deletion or access to a jail must be done through this class. This class is thread-safe which is not the case of the jail itself, including filter and actions. This class is based on Mapping type, and the `add` method must be used to add additional jails. c C s t � | _ t � | _ d S( N( R t _Jails__lockt dictt _jails( t self( ( s9 /usr/lib/python2.7/site-packages/fail2ban/server/jails.pyt __init__) s c C sT | j �E | | j k r1 t rJ t | � � qJ n t | | | � | j | <Wd QXd S( sU Adds a jail. Adds a new jail if not already present which should use the given backend. Parameters ---------- name : str The name of the jail. backend : str The backend to use. db : Fail2BanDb Fail2Ban's persistent database instance. Raises ------ DuplicateJailException If jail name is already present. N( R R t noduplicatesR R ( R t namet backendt db( ( s9 /usr/lib/python2.7/site-packages/fail2ban/server/jails.pyt add- s c C s | | j k S( N( R ( R R ( ( s9 /usr/lib/python2.7/site-packages/fail2ban/server/jails.pyt existsH s c C sU z@ y | j j � | j | SWn t k r>