def get_trail_by_arn(cloudtrail_client, trail_arn):
 trails = cloudtrail_client.describe_trails()['trailList']
 for trail in trails:
  if (trail.get('TrailARN', None) == trail_arn):
   return trail
 raise ValueError(('A trail could not be found for %s' % trail_arn))

def get_trail_by_arn ( cloudtrail_client , trail_arn ) : trails = cloudtrail_client . describe_trails ( ) [ 'trailList' ] for trail in trails : if ( trail . get ( 'TrailARN' , None ) == trail_arn ) : return trail raise ValueError ( ( 'A trail could not be found for %s' % trail_arn ) )
gets trail information based on the trails arn .