'Flush the ban list.
Unban all IP address which are still in the banning list.
If actions specified, don\'t flush list - just execute unban for
given actions (reload, obsolete resp. removed actions).'

def __flushBan(self, db=False, actions=None):

    log = True
    if (actions is None):
        logSys.debug('Flush    ban    list')
        lst = self.__banManager.flushBanList()
    else:
        log = False
        lst = iter(self.__banManager)
    cnt = 0
    unbactions = {}
    for (name, action) in (actions if (actions is not None) else self._actions).iteritems():
        if (hasattr(action, 'flush') and action.actionflush):
            logSys.notice('[%s]    Flush    ticket(s)    with    %s', self._jail.name, name)
            action.flush()
        else:
            unbactions[name] = action
    actions = unbactions
    for ticket in lst:
        if (db and (self._jail.database is not None)):
            ip = str(ticket.getIP())
            self._jail.database.delBan(self._jail, ip)
        self.__unBan(ticket, actions=actions, log=log)
        cnt += 1
    logSys.debug('Unbanned    %s,    %s    ticket(s)    in    %r', cnt, self.__banManager.size(), self._jail.name)
    return cnt
