@@ -429,6 +429,7 @@ def check_licenses(self) -> Dict[str, Any]:
429429 license_data : Dict [str , Any ] = machine .get ("license" , {})
430430 license_use : str = license_data .get ("startOfUseDateTime" )
431431 license_date : datetime = datetime .datetime .strptime (license_use , "%Y-%m-%dT%H:%M:%S.%f%z" )
432+ print (f"{ machine_name } agent install: { license_date } " )
432433 delta : timedelta = now - license_date
433434 if expirationday < delta :
434435 response_dict [machine_name ] = {
@@ -534,13 +535,14 @@ def launch(self) -> Dict[str, Any]:
534535 for machine in json .loads (machines_response .text ).get ("items" , []):
535536 source_props : Dict [str , Any ] = machine .get ("sourceProperties" , {})
536537 machine_data : Dict [str , Any ] = {}
537- if _machine == source_props .get ("name" , "NONE" ):
538+ ce_name = source_props .get ("name" ,"NONE" )
539+ if _machine == ce_name .upper ():
538540 if machine .get ("replica" ):
539541 print ("Target machine already launched" )
540542 self .event_handler .add_event (Event .EVENT_ALREADY_LAUNCHED , machine_name = _machine )
541543 continue
542544 machine_data = {
543- "items" : [{"machineId" : machine [ "id" ] }],
545+ "items" : [{"machineId" : ce_name }],
544546 "launchType" : "TEST" ,
545547 }
546548
@@ -563,7 +565,7 @@ def launch(self) -> Dict[str, Any]:
563565 print ("ERROR: Launch target machine failed!" )
564566 self .event_handler .add_event (Event .EVENT_FAILED , machine_name = _machine )
565567 else :
566- print (f"Machine: ({ source_props ['name' ]} ) - Not a machine we want to launch..." )
568+ # print(f"Machine: ({source_props['name']}) - Not a machine we want to launch...")
567569 self .event_handler .add_event (Event .EVENT_IGNORED , machine_name = _machine )
568570 return response_dict
569571
0 commit comments