flexera-public / right_aws

RightScale Amazon Web Services Ruby Gems
MIT License
451 stars 175 forks source link

Unable to pass connection options for s3 connections #157

Open lwoodson opened 11 years ago

lwoodson commented 11 years ago

When a Rightscale::HttpConnection is created, params are passed into it which can include options such as :http_connection_open_timeout which defaults to 5. However, the :connection_options are not being passed all the way from the programmer API to the RightAwsBaseInterface constructor. Shouldn't:

https://github.com/rightscale/right_aws/blob/master/lib/awsbase/right_awsbase.rb#L413-L433

Be something like:

https://github.com/lwoodson/right_aws/blob/master/lib/awsbase/right_awsbase.rb#L413-L434

This allows overriding the timeout to work correctly:

opts = {:connection_options => {
    :http_connection_open_timeout => 15,
    :http_connection_retry_count => 5}}
bucket = RightAws::S3.new(S3_ACCESS_KEY, S3_SECRET_KEY, opts).bucket(S3_BUCKET)

I am willing to make the bug fix with tests and submit a pull request if you feel like this is the right fix.