First commit creates the retry() function and refactors the code that had "retry" logic in it to use the function.
Second commit adds retry() to a couple more launchpad calls. I ended up sticking to the calls that had some known Exception type, because otherwise I don't know when to retry. I'm open to suggestions on this, otherwise I suppose we can add more retry() calls as time goes and we identify more Exception types that result from launchpad flakiness.
First commit creates the retry() function and refactors the code that had "retry" logic in it to use the function. Second commit adds retry() to a couple more launchpad calls. I ended up sticking to the calls that had some known Exception type, because otherwise I don't know when to retry. I'm open to suggestions on this, otherwise I suppose we can add more retry() calls as time goes and we identify more Exception types that result from launchpad flakiness.