@@ -55,6 +55,7 @@ def fetch_build_time(build):
55
55
56
56
try :
57
57
response = requests .get (url , verify = False , timeout = 15 )
58
+ << << << < HEAD
58
59
if response .status_code == 200 :
59
60
buildtime = json .loads (response .text )
60
61
timestamp_str = buildtime ["metadata" ]["creationTimestamp" ]
@@ -73,6 +74,24 @@ def fetch_build_time(build):
73
74
else :
74
75
return 'ERROR'
75
76
77
+ == == == =
78
+ response .raise_for_status () # Raise exception for non-200 responses
79
+
80
+ buildtime = response .json () # Directly parse JSON
81
+ timestamp_str = buildtime ["metadata" ]["creationTimestamp" ]
82
+
83
+ # Convert timestamp to datetime object (UTC)
84
+ utc_time = datetime .strptime (timestamp_str , "%Y-%m-%dT%H:%M:%SZ" )
85
+
86
+ # Convert UTC to IST (UTC +5:30)
87
+ ist_time = utc_time + timedelta (hours = 5 , minutes = 30 )
88
+
89
+ # Extract date and time separately
90
+ ist_date = ist_time .strftime ("%Y-%m-%d" ) # YYYY-MM-DD
91
+ ist_time_formatted = ist_time .strftime ("%H:%M" ) # HH:MM (without seconds)
92
+
93
+ return ist_date , ist_time_formatted # Returning both date and time
94
+ >> >> >> > 2464102 (Added Time in both brief and detailed output )
76
95
77
96
except requests .Timeout :
78
97
return "Request timed out" , None
@@ -1323,7 +1342,11 @@ def get_detailed_job_info(build_list,prow_ci_name,zone=None):
1323
1342
date ,time = fetch_build_time (build )
1324
1343
1325
1344
print (i ,"Job link:" + constants .JOB_LINK_URL + build )
1345
+ < << << << HEAD
1326
1346
print ("Build start time: " + time + " " + date )
1347
+ == == == =
1348
+ print ("Build started time: " + time + " " + date )
1349
+ >> >> >> > 2464102 (Added Time in both brief and detailed output )
1327
1350
1328
1351
build_status = check_job_status (build )
1329
1352
sensitive_info_expose_status = check_if_sensitive_info_exposed (build )
0 commit comments