aws 2.3.32 → 2.3.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -232,7 +232,7 @@ module Aws
232
232
  # p service #=> {"max-keys"=>"2", "prefix"=>"logs", "name"=>"my_awesome_bucket", "marker"=>"", "is_truncated"=>true}
233
233
  #
234
234
  def keys_and_service(options={}, head=false)
235
- opt = {}; options.each { |key, value| opt[key.to_s] = value }
235
+ opt = {}; options.each { |key, value| opt[key.to_s] = value }
236
236
  service_data = {}
237
237
  thislist = {}
238
238
  list = []
@@ -364,6 +364,11 @@ module Aws
364
364
  force ? @s3.interface.force_delete_bucket(@name) : @s3.interface.delete_bucket(@name)
365
365
  end
366
366
 
367
+ # Deletes an object from s3 in this bucket.
368
+ def delete_key(key)
369
+ @s3.interface.delete(name, key)
370
+ end
371
+
367
372
  # Return a list of grantees.
368
373
  #
369
374
  def grantees
@@ -615,7 +620,7 @@ module Aws
615
620
  # key.reload_meta #=> {"family"=>"oops", "race" => "troll"}
616
621
  #
617
622
  def save_meta(meta_headers)
618
- meta = self.class.add_meta_prefix(meta_headers)
623
+ meta = self.class.add_meta_prefix(meta_headers)
619
624
  @bucket.s3.interface.copy(@bucket.name, @name, @bucket.name, @name, :replace, meta)
620
625
  @meta_headers = self.class.split_meta(meta)[1]
621
626
  end
@@ -389,7 +389,7 @@ module Aws
389
389
 
390
390
  #
391
391
  # items is an array of Aws::SdbInterface::Item.new(o.id, o.attributes, true)
392
- def batch_put_attributes(domain_name, items)
392
+ def batch_put_attributes(domain_name, items, options={})
393
393
  params = {'DomainName' => domain_name}
394
394
  i = 0
395
395
  items.each do |item|
@@ -399,7 +399,17 @@ module Aws
399
399
  i += 1
400
400
  end
401
401
  link = generate_request("BatchPutAttributes", params)
402
- request_info(link, QSdbSimpleParser.new)
402
+ begin
403
+ request_info(link, QSdbSimpleParser.new, options)
404
+ rescue Aws::AwsError => ex
405
+ # puts "RESCUED in batch_put_attributes: " + $!
406
+ if options[:create_domain] && create_domain_if_not_exist(ex, domain_name)
407
+ options.delete(:create_domain)
408
+ batch_put_attributes(domain_name, items, options)
409
+ else
410
+ raise ex
411
+ end
412
+ end
403
413
  rescue Exception
404
414
  on_exception
405
415
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 3
8
- - 32
9
- version: 2.3.32
8
+ - 34
9
+ version: 2.3.34
10
10
  platform: ruby
11
11
  authors:
12
12
  - Travis Reeder
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-19 00:00:00 -08:00
19
+ date: 2010-12-22 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency