Add RetryByNumberOfTimes utility function
authorHelga Velroyen <helgav@google.com>
Wed, 22 Apr 2015 11:57:28 +0000 (13:57 +0200)
committerHelga Velroyen <helgav@google.com>
Tue, 28 Apr 2015 14:59:57 +0000 (16:59 +0200)
commit9d8e3a9d14406f3182b8cd9c3a21cd868e5d0322
tree704436928e8864392bdd7615c5a96ef00e099658
parentd95f32a46ea269e12f03eadf89c1a5cf308587af
Add RetryByNumberOfTimes utility function

This patch adds the RetryByNumberOfTimes utility function
which wraps around a given function and calls that one
up to a maximum number of times before raising a final
exception.

This function is used in the SSH key updating code in
backend.py.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
lib/backend.py
lib/utils/retry.py