@@ -331,6 +331,23 @@ def check_if_gather_libvirt_dir_exists(spy_link,job_type):
331
331
except requests .RequestException :
332
332
return "Error while sending request to url"
333
333
334
+ #This is a fix to check for sensitive information expose error.
335
+ def check_if_sensitive_info_exposed (spy_link ):
336
+
337
+ build_log_url = PROW_VIEW_URL + spy_link [8 :] + '/build-log.txt'
338
+ try :
339
+ response = requests .get (build_log_url , verify = False , timeout = 15 )
340
+ senstive_info_re = re .compile ('This file contained potentially sensitive information and has been removed.' )
341
+ senstive_info_re_match = senstive_info_re .search (response .text )
342
+ if senstive_info_re_match is not None :
343
+ return True
344
+ else :
345
+ return False
346
+ except requests .Timeout :
347
+ return "Request timed out"
348
+ except requests .RequestException :
349
+ return "Error while sending request to url"
350
+
334
351
def get_node_status (spy_link ):
335
352
336
353
'''
@@ -1111,12 +1128,16 @@ def get_brief_job_info(prow_ci_name,prow_ci_link,start_date=None,end_date=None,z
1111
1128
continue
1112
1129
job_status = check_job_status (job )
1113
1130
cluster_status = cluster_deploy_status (job )
1131
+ sensitive_info_expose_status = check_if_sensitive_info_exposed (job )
1114
1132
i = i + 1
1115
1133
job_dict = {}
1116
1134
job_dict ["Build" ] = prow_ci_name
1117
1135
job_dict ["Prow Job ID" ] = job_id
1118
1136
job_dict ["Install Status" ] = cluster_status
1119
- job_dict ["Lease" ]= lease
1137
+ if sensitive_info_expose_status == True :
1138
+ job_dict ["Lease" ]= "Build log removed"
1139
+ else :
1140
+ job_dict ["Lease" ]= lease
1120
1141
if job_status == 'SUCCESS' and "sno" not in prow_ci_link :
1121
1142
job_dict ["Test result" ] = "PASS"
1122
1143
elif job_status == 'FAILURE' and "sno" not in prow_ci_link :
@@ -1172,11 +1193,22 @@ def get_detailed_job_info(prow_ci_name,prow_ci_link,start_date=None,end_date=Non
1172
1193
continue
1173
1194
i = i + 1
1174
1195
print (i ,"Job link: https://prow.ci.openshift.org/" + job )
1175
- print ( "Nightly info-" , nightly )
1196
+
1176
1197
job_status = check_job_status (job )
1198
+ sensitive_info_expose_status = check_if_sensitive_info_exposed (job )
1199
+
1200
+ if sensitive_info_expose_status == True :
1201
+ print ("*********************************" )
1202
+ print ("Build log removed" )
1203
+ print ("*********************************" )
1204
+
1205
+ print ("Nightly info-" , nightly )
1206
+
1177
1207
if job_status == 'SUCCESS' :
1178
1208
deploy_count += 1
1179
1209
e2e_count = e2e_count + 1
1210
+ if "sno" not in job :
1211
+ print ("Lease Quota-" , lease )
1180
1212
check_node_crash (job )
1181
1213
print ("This is a Green build" )
1182
1214
elif job_status == 'FAILURE' :
0 commit comments