@@ -365,6 +365,23 @@ def check_if_gather_libvirt_dir_exists(spy_link,job_type):
365
365
return "Request timed out"
366
366
except requests .RequestException :
367
367
return "Error while sending request to url"
368
+
369
+ #This is to check for hypervisor error
370
+ def check_hypervisor_error (spy_link ):
371
+ build_log_url = constants .PROW_VIEW_URL + spy_link [8 :] + '/build-log.txt'
372
+ try :
373
+ response = requests .get (build_log_url , verify = False , timeout = 15 )
374
+ hypervisor_re = re .compile (constants .HYPERVISOR_CONNECTION_ERROR )
375
+ hypervisor_re_match = hypervisor_re .search (response .text )
376
+ if hypervisor_re_match is not None :
377
+ return True
378
+ else :
379
+ return False
380
+ except requests .Timeout :
381
+ return "Request timed out"
382
+ except requests .RequestException :
383
+ return "Error while sending request to url"
384
+
368
385
369
386
#This is a fix to check for sensitive information expose error.
370
387
def check_if_sensitive_info_exposed (spy_link ):
@@ -1223,6 +1240,10 @@ def get_brief_job_info(build_list,prow_ci_name,zone=None):
1223
1240
job_dict ["Test result" ] = str (e2e_fail_test_count ) + " testcases failed"
1224
1241
else :
1225
1242
job_dict ["Test result" ] = "Failed to get Test summary"
1243
+ else :
1244
+ hypervisor_error_status = check_hypervisor_error (build )
1245
+ if hypervisor_error_status :
1246
+ job_dict ["Test result" ] = constants .HYPERVISOR_CONNECTION_ERROR
1226
1247
summary_list .append (job_dict )
1227
1248
return summary_list
1228
1249
@@ -1281,7 +1302,11 @@ def get_detailed_job_info(build_list,prow_ci_name,zone=None):
1281
1302
print ("Lease Quota-" , lease )
1282
1303
node_status = get_node_status (build )
1283
1304
print (node_status )
1284
- check_node_crash (build )
1305
+ hypervisor_error_status = check_hypervisor_error (build )
1306
+ if hypervisor_error_status :
1307
+ print ("Cluster Creation Failed." + constants .HYPERVISOR_CONNECTION_ERROR )
1308
+ else :
1309
+ check_node_crash (build )
1285
1310
1286
1311
if cluster_status == 'SUCCESS' :
1287
1312
deploy_count += 1
@@ -1293,8 +1318,9 @@ def get_detailed_job_info(build_list,prow_ci_name,zone=None):
1293
1318
1294
1319
elif cluster_status == 'FAILURE' :
1295
1320
print ("Cluster Creation Failed" )
1321
+
1296
1322
1297
- elif cluster_status == 'ERROR' :
1323
+ elif cluster_status == 'ERROR' and not hypervisor_error_status :
1298
1324
print ('Unable to get cluster status please check prowCI UI ' )
1299
1325
else :
1300
1326
print (build_status )
0 commit comments