Skip to content

Commit 6dbd58a

Browse files
author
Kevin Reynolds
committed
test new lb2 test
1 parent b104992 commit 6dbd58a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

labapp/app/app.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,17 @@ def lb_azure():
247247
if not ns:
248248
raise LabException("Ephemeral NS not set")
249249
url = f"https://{ns}.{app.config['base_url']}"
250-
data = cloudapp_fetch(session, url, 7, 'env', 'Azure')
251-
return jsonify(status='success', data=data)
252-
except (LabException, requests.RequestException, ValueError) as e:
250+
for _ in range(5):
251+
try:
252+
data = cloudapp_fetch(session, url, 7, 'env', 'Azure')
253+
return jsonify(status='success', data=data)
254+
except ValueError:
255+
pass
256+
raise ValueError("Failed to find Azure Origin Pool")
257+
except (LabException, ValueError) as e:
253258
return jsonify(status='fail', error=str(e))
259+
except requests.RequestException:
260+
return jsonify(status='fail', error="Connection/Request Error")
254261

255262
@app.route('/_route1')
256263
def route1():

0 commit comments

Comments
 (0)