Add a generic function capable of watching a file
Add a generic function capable of watching a file

Add a method to return the new value of a function if it changes within
the given timeout. If not, return the old value. Make use of the fact,
that the function only changes, if the specified file changes on disk.

Signed-off-by: Klaus Aehlig <4ce51de36d9068cd7db2eec1151e0f3f95419008@google.com>
Reviewed-by: Petr Pudlak <9d19625f8ee825a2c398462ed335cbcf98f79c32@google.com>

dimara/ganeti,apyrgio/ganeti,mbakke/ganeti,onponomarev/ganeti,grnet/snf-ganeti,onponomarev/ganeti,dimara/ganeti,bitemyapp/ganeti,yiannist/ganeti,ganeti/ganeti,mbakke/ganeti,andir/ganeti,mbakke/ganeti,ganeti-github-testing/ganeti-test-1,apyrgio/ganeti,andir/ganeti,leshchevds/ganeti,ganeti-github-testing/ganeti-test-1,leshchevds/ganeti,ganeti/ganeti,bitemyapp/ganeti,yiannist/ganeti,yiannist/ganeti,ganeti/ganeti,leshchevds/ganeti,andir/ganeti,grnet/snf-ganeti