Merge pull request #3307 from evertrue/evertrue/eherot/do_not_unnecessarily_throw_path_style_warning

Do not throw a warning about falling back to path_style
This commit is contained in:
Wesley Beary 2014-12-02 10:59:44 -06:00
Родитель 46a7a47d04 09666e0910
Коммит ccf96e75a1
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -220,13 +220,15 @@ module Fog
bucket_name = params[:bucket_name]
path_style = params.fetch(:path_style, @path_style)
if !path_style && COMPLIANT_BUCKET_NAMES !~ bucket_name
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
path_style = true
elsif scheme == 'https' && bucket_name =~ /\./
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
path_style = true
end
if !path_style
if COMPLIANT_BUCKET_NAMES !~ bucket_name
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) is not a valid dns name, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
path_style = true
elsif scheme == 'https' && bucket_name =~ /\./
Fog::Logger.warning("fog: the specified s3 bucket name(#{bucket_name}) contains a '.' so is not accessible over https as a virtual hosted bucket, which will negatively impact performance. For details see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/BucketRestrictions.html")
path_style = true
end
end
if path_style
path = bucket_to_path bucket_name, path