lib/backup/cloud_io/s3.rb in backup-3.8.0 vs lib/backup/cloud_io/s3.rb in backup-3.9.0
- old
+ new
@@ -12,11 +12,12 @@
MAX_FILE_SIZE = 1024**3 * 5 # 5 GiB
MAX_MULTIPART_SIZE = 1024**4 * 5 # 5 TiB
attr_reader :access_key_id, :secret_access_key, :use_iam_profile,
- :region, :bucket, :chunk_size, :encryption, :storage_class
+ :region, :bucket, :chunk_size, :encryption, :storage_class,
+ :fog_options
def initialize(options = {})
super
@access_key_id = options[:access_key_id]
@@ -25,10 +26,11 @@
@region = options[:region]
@bucket = options[:bucket]
@chunk_size = options[:chunk_size]
@encryption = options[:encryption]
@storage_class = options[:storage_class]
+ @fog_options = options[:fog_options]
end
# The Syncer may call this method in multiple threads.
# However, #objects is always called prior to multithreading.
def upload(src, dest)
@@ -128,9 +130,10 @@
opts.merge!(
:aws_access_key_id => access_key_id,
:aws_secret_access_key => secret_access_key
)
end
+ opts.merge!(fog_options || {})
conn = Fog::Storage.new(opts)
conn.sync_clock
conn
end
end