Retry glance add/update locations on BadRequest

If glance is unable to fetch the http image URL we give it due to
transient network problems, we currently fail the test because it
does not retry itself and we get a BadRequest. Because such problems
can happen in a CI run due to network interruptions, this adds a
retry loop on that condition when we go to add a location. If we fail
to add the location for some legit reason related to our actual
location URI or other parts of the request, all the retries will
fail and we'll still catch the problem.

Change-Id: I944eb076c9f9056200dc193b52f2004038a6942f
Related-Bug: #2004641
Related-Bug: #1999800
Related-Bug: #2006473
1 file changed