mirror of https://github.com/fail2ban/fail2ban
small amend: if not on-demand, the families should be specified (or default), also avoids error "dictionary changed size during iteration"
parent
67fd75c88e
commit
a527fbcae5
|
@ -440,17 +440,13 @@ class CommandAction(ActionBase):
|
||||||
@property
|
@property
|
||||||
def _hasCondSection(self):
|
def _hasCondSection(self):
|
||||||
v = self._properties.get('__hasCondSection')
|
v = self._properties.get('__hasCondSection')
|
||||||
if v is None:
|
if v is not None:
|
||||||
|
return v
|
||||||
v = False
|
v = False
|
||||||
famset = set()
|
|
||||||
for n in self._properties:
|
for n in self._properties:
|
||||||
grp = CONDITIONAL_FAM_RE.match(n)
|
if CONDITIONAL_FAM_RE.match(n):
|
||||||
if grp:
|
v = True
|
||||||
self._properties['__hasCondSection'] = v = True
|
|
||||||
if self._properties.get('families') or self._startOnDemand:
|
|
||||||
break
|
break
|
||||||
famset.add(grp.group(2))
|
|
||||||
self._properties['__families'] = famset
|
|
||||||
self._properties['__hasCondSection'] = v
|
self._properties['__hasCondSection'] = v
|
||||||
return v
|
return v
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue