@@ -17,21 +17,29 @@ def fetch_release_date(release):
17
17
'''
18
18
Returns the created date of release
19
19
'''
20
- url = constants . RELEASE_URL + release
20
+
21
21
try :
22
+ url = constants .STABLE_RELEASE_URL + release
22
23
response = requests .get (url , verify = False , timeout = 15 )
24
+ if response .status_code == 404 :
25
+ url = constants .DEV_PREVIEW_RELEASE_URL + release
26
+ response = requests .get (url , verify = False , timeout = 15 )
27
+ if response .status_code == 404 :
28
+ print (f"Failed to get the release page. { response .text } " )
29
+ sys .exit (1 )
23
30
if response .status_code == 200 :
24
- soup = BeautifulSoup (response .text , 'html.parser' )
25
- p_elements = soup .find_all ("p" )
26
- for p in p_elements :
31
+ soup = BeautifulSoup (response .text , 'html.parser' )
32
+ p_elements = soup .find_all ("p" )
33
+ for p in p_elements :
27
34
p_ele = p .string
28
35
if p_ele :
29
36
if "Created:" in p_ele :
30
37
start_date = p_ele .split (" " )[1 ]+ " " + p_ele .split (" " )[2 ]
31
38
break
32
- return start_date
33
- else :
34
- return "failed to get the release page"
39
+ return start_date
40
+ else :
41
+ print (f"Failed to get the release page. { response .text } " )
42
+ sys .exit (1 )
35
43
except requests .Timeout as e :
36
44
return "Request timed out"
37
45
except requests .RequestException as e :
@@ -398,6 +406,23 @@ def check_if_gather_libvirt_dir_exists(spy_link,job_type):
398
406
return "Request timed out"
399
407
except requests .RequestException :
400
408
return "Error while sending request to url"
409
+
410
+ #This is to check for hypervisor error
411
+ def check_hypervisor_error (spy_link ):
412
+ build_log_url = constants .PROW_VIEW_URL + spy_link [8 :] + '/build-log.txt'
413
+ try :
414
+ response = requests .get (build_log_url , verify = False , timeout = 15 )
415
+ hypervisor_re = re .compile (constants .HYPERVISOR_CONNECTION_ERROR )
416
+ hypervisor_re_match = hypervisor_re .search (response .text )
417
+ if hypervisor_re_match is not None :
418
+ return True
419
+ else :
420
+ return False
421
+ except requests .Timeout :
422
+ return "Request timed out"
423
+ except requests .RequestException :
424
+ return "Error while sending request to url"
425
+
401
426
402
427
#This is a fix to check for sensitive information expose error.
403
428
def check_if_sensitive_info_exposed (spy_link ):
@@ -1258,6 +1283,10 @@ def get_brief_job_info(build_list,prow_ci_name,zone=None):
1258
1283
job_dict ["Test result" ] = str (e2e_fail_test_count ) + " testcases failed"
1259
1284
else :
1260
1285
job_dict ["Test result" ] = "Failed to get Test summary"
1286
+ else :
1287
+ hypervisor_error_status = check_hypervisor_error (build )
1288
+ if hypervisor_error_status :
1289
+ job_dict ["Test result" ] = constants .HYPERVISOR_CONNECTION_ERROR
1261
1290
summary_list .append (job_dict )
1262
1291
return summary_list
1263
1292
@@ -1319,7 +1348,11 @@ def get_detailed_job_info(build_list,prow_ci_name,zone=None):
1319
1348
print ("Lease Quota-" , lease )
1320
1349
node_status = get_node_status (build )
1321
1350
print (node_status )
1322
- check_node_crash (build )
1351
+ hypervisor_error_status = check_hypervisor_error (build )
1352
+ if hypervisor_error_status :
1353
+ print ("Cluster Creation Failed." + constants .HYPERVISOR_CONNECTION_ERROR )
1354
+ else :
1355
+ check_node_crash (build )
1323
1356
1324
1357
if cluster_status == 'SUCCESS' :
1325
1358
deploy_count += 1
@@ -1331,8 +1364,9 @@ def get_detailed_job_info(build_list,prow_ci_name,zone=None):
1331
1364
1332
1365
elif cluster_status == 'FAILURE' :
1333
1366
print ("Cluster Creation Failed" )
1367
+
1334
1368
1335
- elif cluster_status == 'ERROR' :
1369
+ elif cluster_status == 'ERROR' and not hypervisor_error_status :
1336
1370
print ('Unable to get cluster status please check prowCI UI ' )
1337
1371
else :
1338
1372
print (build_status )
0 commit comments