Merge pull request #647 from yarikoptic/0.8

Minor fixes for claimed compatibility with 2.4 and 2.5 -- not to be "merged" into 0.9
BF: Handle case when inotify watch is auto deleted on file deletion

When a file is deleted, the watcher for it is automatically removed.
FilterPyinotify is detecting a new file being created with the same
name, and in turn attempts to remove the watch for the deleted file
(which has already been removed automatically).

Also, IN_IGNORED events are generated when a file is deleted, but these
weren't being caught, causing an non-existent file path to be passed to
FilterPyinotify._process_file (which caught the exceptions in
Filter.getFailures).
Merge pull request #669 from kwirk/inotify-watch-auto-remove

BF: Handle case when inotify watch is auto deleted on file deletion
TST: Close file to allow proper removal in MonitorFailures
DOC: Update ChangeLog
ENH: run travis with both 'error' and 'heavydebug' levels to ease troubleshooting of failures
Merge pull request #691 from yarikoptic/enh/travis_multiple_log_levels

ENH: run travis with both 'error' and 'heavydebug' levels to ease troubleshooting of failures
BF: give a custom prefix to a tempfile and close it upon tearDown in ExecuteActions tests
DOC: minor wording fix
BF(?): stop/join notifier only if defined

Somehow on that elderly squeeze Debian sparc box, I got error that self.__notifier
was not defined.  So first I did define it now in the constructor, but mystery remains
how come it was not defined -- wasn"t run() then run (where it is defined)?

Anyways -- conditioning on it being defined might be safer may be?
Not sure (need to go to sleep) if with this change but on this box I also run from time
to time either into stalling of fail2ban-testcases and refusing to exit normally or

======================================================================
ERROR: test_move_into_file_after_removed (testcases.filtertestcase.MonitorFailures<FilterPyinotify>(/tmp/monitorfailures_FilterPyinotifypcHmMJfail2ban))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yoh/deb/gits/fail2ban/testcases/filtertestcase.py", line 473, in tearDown
    self.filter.stop()
  File "/home/yoh/deb/gits/fail2ban/server/filterpyinotify.py", line 196, in stop
    self.__notifier.stop()
  File "/usr/lib/pymodules/python2.6/pyinotify.py", line 1315, in stop
    threading.Thread.join(self)
  File "/usr/lib/python2.6/threading.py", line 633, in join
    raise RuntimeError("cannot join thread before it is started")
RuntimeError: cannot join thread before it is started

that is with pyinotify 0.8.9-1 so could quite be "related" to its age.
ENH: use unique filename in LogFileFilterPoll on every setUp call
BF: overcome problem with failed *_movefile test if file gets properly closed

Discussion is in the comments on 7260403fdd41b74335a0a71579df3df5cae6c6ba
and fix consists of skipping first 3 lines while creating a "new" log file.
This should be sufficient to make fail2ban detect "log rotation" and thus
function properly
DOC: changelog entry on leaky file descriptors
BF(2.5): add minimal_python key to failJSON and skip some test lines with date format which includes sub-seconds

For tests to pass also duplicated representative ones just without subsec timing
Add .dev suffix to the version to signal "development" build
ENH(TST): relax test of sleep to "1" places from "2"

The reason is that internally it does round, so even 1.005 then would not
be equal to 1.  Making it spaces==1 should be sufficient for up to 1.05
i.e. we would allow 50ms "drift"
Merge pull request #694 from yarikoptic/bf/fix_move_test

a collection of fixes, including the one log rotation detection which "broke travis"
Merge pull request #696 from yarikoptic/bf/skip_apache_subsecond_resolution_on_2.5

BF(2.5): add minimal_python key to failJSON and skip some test lines.
BF: grep in mail*-whois-lines.conf also matches beginning/end of line to work with the recidive filter (Debian #744774)

Thanks James Bottomley for the report and tentative solutions
Update comments in shorewall.conf for new settings