@@ -31,30 +31,28 @@ def get_plans_from_project(project_key):
3131if __name__ == "__main__" :
3232 bamboo = Bamboo (url = BAMBOO_URL , username = BAMBOO_LOGIN , password = BAMBOO_PASSWORD , timeout = 180 )
3333 projects = get_all_projects ()
34- print (("Start analyzing the {} projects" . format ( len (projects )) ))
34+ print ((f "Start analyzing the { len (projects )} projects" ))
3535 for project in projects :
36- print (("Inspecting {} project" . format ( project ) ))
36+ print ((f "Inspecting { project } project" ))
3737 plans = get_plans_from_project (project )
38- print (("Start analyzing the {} plans" . format ( len (plans )) ))
38+ print ((f "Start analyzing the { len (plans )} plans" ))
3939 for plan in plans :
40- print (("Inspecting {} plan" . format ( plan ) ))
40+ print ((f "Inspecting { plan } plan" ))
4141 build_results = [
4242 x for x in bamboo .results (plan_key = plan , label = LABEL , max_results = 100 , include_all_states = True )
4343 ]
4444 for build in build_results :
4545 build_key = build .get ("buildResultKey" ) or None
46- print (("Inspecting {} build" . format ( build_key ) ))
46+ print ((f "Inspecting { build_key } build" ))
4747 build_value = bamboo .build_result (build_key )
4848 build_complete_time = build_value .get ("buildCompletedTime" ) or None
4949 if not build_complete_time :
5050 continue
5151 datetimeObj = datetime .strptime (build_complete_time .split ("+" )[0 ] + "000" , "%Y-%m-%dT%H:%M:%S.%f" )
5252 if datetime .now () > datetimeObj + timedelta (days = OLDER_DAYS ):
5353 print ((
54- "Build is old {} as build complete date {}" .format (
55- build_key , build_complete_time .strftime ("%Y-%m-%d" )
56- )
54+ f"Build is old { build_key } as build complete date { build_complete_time .strftime ('%Y-%m-%d' )} "
5755 ))
5856 if not DRY_RUN :
59- print (("Removing {} build" . format ( build_key ) ))
57+ print ((f "Removing { build_key } build" ))
6058 bamboo .delete_build_result (build_key )
0 commit comments