a
=*f@w @ st d Z dZdZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZ zddl
mZ W n ey ddlmZ Y n0 ddlmZ dd lmZ dd
lmZ ddlmZ dd
lmZmZmZmZmZmZm Z ee!Z"e # Z$ej%Z&e'dZ(dZ)e'dZ*dd dd dZ+dddZ,e,-e+ G dd dee.Z/G dd de.edZ0dddZ1G d d! d!e0Z2dS )"z'Cyril Jaquier and Fail2Ban Contributorsz>Copyright (c) 2004 Cyril Jaquier, 2011-2012 Yaroslav HalchenkoZGPL N)ABCMeta)MutableMapping )
mapTag2Opt)DNSUtils)MyTime)Utils ) getLogger_merge_copy_dicts
splitwordssubstituteRecursiveTags
uni_stringTAG_CREMAX_TAG_REPLACE_COUNTz)inet4inet6z^(\w+)\?(family)=(.*)$c C s t tjddS )NTZfqdnstrr ZgetHostname r r :/usr/lib/python3.9/site-packages/fail2ban/server/action.py? r c C s t tjddS )NFr r r r r r r @ r )zfq-hostnamezsh-hostname
)brspc @ s e Zd ZdZdZdZdd ZdddZd d
dZeZ d!d
dZ
dd Zdd Zdd Z
dd Zdd Zdd Zdd Zdd ZdS )"
CallingMapa" A Mapping type which returns the result of callable values.
`CallingMap` behaves similar to a standard python dictionary,
with the exception that any values which are callable, are called
and the result is returned as the value.
No error handling is in place, such that any errors raised in the
callable will raised as usual.
Actual dictionary is stored in property `data`, and can be accessed
to obtain original callable values.
Attributes
----------
data : dict
The dictionary data which can be accessed to obtain items uncalled
r )datastorage immutableZ
__org_datac O s" t | _d| _t |i || _d S )NT)dictr r! r )selfargskwargsr r r __init___ s zCallingMap.__init__Tc C s2 t | _z| j| _W n ty& Y n0 || _d S N)r" r _CallingMap__org_datar AttributeErrorr! )r# r! r r r resetd s zCallingMap.resetFc C s d| j j| |tf S )Nz%s(%r)) __class____name___asdictr )r#
calculatedr r r _asreprl s zCallingMap._asreprNc s t jfi j}|s2t fdd| D S t| D ]@\}}t|r>z" |}|rf|| |||<