eventscripts: Rewrite the smb.conf cache file handling
authorMartin Schwenke <martin@meltin.net>
Mon, 28 Oct 2013 05:00:54 +0000 (16:00 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 29 Oct 2013 06:14:55 +0000 (17:14 +1100)
commit8c6f511254ecb0381a609b37e3a0ee6e5ec5d562
tree26942b8350872e830f283ab007f4da9cacd9ec06
parentc072eb1f6488f94f83a6d3a81d88bf29ad866943
eventscripts: Rewrite the smb.conf cache file handling

The background update is never guaranteed to complete before the cache
is used, so don't bother trying it at the beginning.  Instead, put a
timeout on a foreground update.

If the foreground update fails:

* If there's no available cache file then die.

* If there is a previous cache file then use it and log a warning.

* Do a background update at the end of the monitor event.

Also remove commas in the "smb ports" list before use, since (newer?)
testparm seem to insert commas into the default value.  Update the
associated test to add a comma.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
config/events.d/50.samba
tests/eventscripts/stubs/testparm