@@ -469,9 +469,7 @@ def update_encryption_key(self, kms_id: str) -> bool:
469469 def check_licenses (self ) -> Dict [str , Any ]:
470470 """Check licenses for all available instances in a given project."""
471471 response_dict : Dict [str , Any ] = {}
472- print (
473- f"Checking CloudEndure Licenses - Name: ({ self .project_name } )"
474- )
472+ print (f"Checking CloudEndure Licenses - Name: ({ self .project_name } )" )
475473
476474 now : datetime = datetime .datetime .now (datetime .timezone .utc )
477475 expirationday : timedelta = datetime .timedelta (days = 90 )
@@ -486,15 +484,25 @@ def check_licenses(self) -> Dict[str, Any]:
486484 machine_name : str = source_props .get ("name" )
487485 license_data : Dict [str , Any ] = machine .get ("license" , {})
488486 license_use : str = license_data .get ("startOfUseDateTime" )
489- license_date : datetime = datetime .datetime .strptime (license_use , '%Y-%m-%dT%H:%M:%S.%f%z' )
487+ license_date : datetime = datetime .datetime .strptime (
488+ license_use , "%Y-%m-%dT%H:%M:%S.%f%z"
489+ )
490490 delta : timedelta = now - license_date
491- if (expirationday < delta ):
492- response_dict [machine_name ] = { "machine_id" : machine_id , "status" : "expired" , "delta_days" : delta .days }
493- elif (expirationwarn < delta ):
494- response_dict [machine_name ] = { "machine_id" : machine_id , "status" : "warn" , "delta_days" : delta .days }
491+ if expirationday < delta :
492+ response_dict [machine_name ] = {
493+ "machine_id" : machine_id ,
494+ "status" : "expired" ,
495+ "delta_days" : delta .days ,
496+ }
497+ elif expirationwarn < delta :
498+ response_dict [machine_name ] = {
499+ "machine_id" : machine_id ,
500+ "status" : "warn" ,
501+ "delta_days" : delta .days ,
502+ }
495503
496504 return response_dict
497-
505+
498506 def update_blueprint (self ) -> bool :
499507 """Update the blueprint associated with the specified machines."""
500508 print (
0 commit comments