def is_valid_info_file(path):
 digest_size = (hashlib.sha1().digestsize * 2)
 regexp = (CONF.image_info_filename_pattern % {'image': ('([0-9a-f]{%(digest_size)d}|[0-9a-f]{%(digest_size)d}_sm|[0-9a-f]{%(digest_size)d}_[0-9]+)' % {'digest_size': digest_size})})
 m = re.match(regexp, path)
 if m:
  return True
 return False

def is_valid_info_file ( path ) : digest_size = ( hashlib . sha1 ( ) . digestsize * 2 ) regexp = ( CONF . image_info_filename_pattern % { 'image' : ( '([0-9a-f]{%(digest_size)d}|[0-9a-f]{%(digest_size)d}_sm|[0-9a-f]{%(digest_size)d}_[0-9]+)' % { 'digest_size' : digest_size } ) } ) m = re . match ( regexp , path ) if m : return True return False
test if a given path matches the pattern for info files .