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