HEX
Server: LiteSpeed
System: Linux 112.webhostingindonesia.co.id 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
User: iyfwylsv (10313)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/fail2ban/server/__pycache__/jails.cpython-39.pyc
a

ONh��`�h�@sxdZdZdZddlmZzddlmZWneyFddlmZYn0ddl	m
Z
mZdd	lm
Z
Gd
d�de�ZdS)
z!Cyril Jaquier, Yaroslav Halchenkoz:Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenko�GPL�)�Lock)�Mapping�)�DuplicateJailException�UnknownJailException�)�Jailc@sJeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�JailsaBHandles 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.
	cCst�|_t�|_dS�N)r�_Jails__lock�dict�_jails��self�r�9/usr/lib/python3.9/site-packages/fail2ban/server/jails.py�__init__,szJails.__init__NcCsP|j�6||jvrt|��nt|||�|j|<Wd�n1sB0YdS)aUAdds 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rrr	)r�nameZbackendZdbrrr�add0s

z	Jails.addcCs
||jvSr)r�rrrrr�existsJszJails.existscCs^zLz"|j��|j|WW|j��Sty>t|��Yn0W|j��n|j��0dSr)r�acquirer�release�KeyErrorrrrrr�__getitem__Ms

�zJails.__getitem__cCsRz@z|j��|j|=Wnty2t|��Yn0W|j��n|j��0dSr)rrrrrrrrrr�__delitem__Vs
zJails.__delitem__cCs2z |j��t|j�W|j��S|j��0dSr)rr�lenrrrrrr�__len___s


�z
Jails.__len__cCs2z |j��t|j�W|j��S|j��0dSr)rr�iterrrrrrr�__iter__fs


�zJails.__iter__)N)�__name__�
__module__�__qualname__�__doc__rrrrrrr rrrrr
"s	
		r
N)�
__author__�
__copyright__�__license__�	threadingr�collections.abcr�ImportError�collections�
exceptionsrrZjailr	r
rrrr�<module>s