def _find_file_meta(metadata, bucket_name, saltenv, path):
 env_meta = (metadata[saltenv] if (saltenv in metadata) else {})
 bucket_meta = (env_meta[bucket_name] if (bucket_name in env_meta) else {})
 files_meta = list(list(filter((lambda k: ('Key' in k)), bucket_meta)))
 for item_meta in files_meta:
  if (('Key' in item_meta) and (item_meta['Key'] == path)):
   try:
    item_meta['ETag'] = item_meta['ETag'].strip('"')
   except KeyError:
    pass
   return item_meta

def _find_file_meta ( metadata , bucket_name , saltenv , path ) : env_meta = ( metadata [ saltenv ] if ( saltenv in metadata ) else { } ) bucket_meta = ( env_meta [ bucket_name ] if ( bucket_name in env_meta ) else { } ) files_meta = list ( list ( filter ( ( lambda k : ( 'Key' in k ) ) , bucket_meta ) ) ) for item_meta in files_meta : if ( ( 'Key' in item_meta ) and ( item_meta [ 'Key' ] == path ) ) : try : item_meta [ 'ETag' ] = item_meta [ 'ETag' ] . strip ( '"' ) except KeyError : pass return item_meta
looks for a files metadata in the s3 bucket cache file .