openstack 3.3.9 → 3.3.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6cf5b9c2abe7046ed912fcd7157e5e381dd604c2
4
- data.tar.gz: d64ab8da5df36ef8d1dc89298f8954a5fbb9202c
3
+ metadata.gz: 3fb68d7f9147cf6dc29f5d36bfa443be3a2fb3f6
4
+ data.tar.gz: 694eea781abc3e6ea82945414527158472c954ec
5
5
  SHA512:
6
- metadata.gz: 67c5b5cdc72ebc746039961915078a0421de3fb1af51ad57c340cc19c1d8c292c52425c92129521fe80b09ccf2bde8ee0a5e00ac55b2582e4b6dd24599c94d58
7
- data.tar.gz: abc8b00eb3856807632fe95a7388bc53afb461cffa99d579a2518dfbe049a47dd194db9f510f94a873e3bf12d12bfcb7e64875ce8d8807cf13ae8b14fb6f6ae4
6
+ metadata.gz: a93bcde725c12dfa82eeb7d8401fed7cfe4dbef688708ac1e627a4bb480758b994642a0a7bf75f4581a2eddfcc2fad45b68f724ad8b7ce05c9cbf9ffe44a07bd
7
+ data.tar.gz: 12acf4b7090ac202d66d663d59e75c5c6c360b18539e749e25bb27cf9759267a960b29cae3f50e6f70daea2e34ee036b6f1bf7c4af1a1d713aec4f4b421bdae7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.9
1
+ 3.3.10
@@ -37,6 +37,7 @@ module Swift
37
37
  # :metadata=>{key=>value, key1=>value1, ...}
38
38
  # :content_type=>content type of created object
39
39
  # :etag=>MD5 checksum of object data to be compared to that on server side
40
+ # :cache_control=>cache control header
40
41
  # :manifest=>set manifest header for segmented large object
41
42
  # }
42
43
  #
@@ -49,6 +50,7 @@ module Swift
49
50
  provided_headers = (headers[:metadata] || {}).inject({}){|res, (k,v)| ((k.to_s.match /^X-Object-Meta-/i) ? res[k.to_s]=v : res["X-Object-Meta-#{k.to_s}"]=v) ;res}
50
51
  provided_headers["content-type"] = headers[:content_type] unless headers[:content_type].nil?
51
52
  provided_headers["ETag"] = headers[:etag] unless headers[:etag].nil?
53
+ provided_headers["Cache-Control"] = headers[:cache_control] unless headers[:cache_control].nil?
52
54
  provided_headers["X-Object-Manifest"] = headers[:manifest] unless headers[:manifest].nil?
53
55
  if data.nil? #just create an empty object
54
56
  path = "/#{container.name}/#{objectname}"
@@ -64,7 +66,7 @@ module Swift
64
66
  # object = container.object("conversion_helper.rb")
65
67
  # => #<OpenStack::Swift::StorageObject:0xb7692488 ....
66
68
  # object.object_metadata
67
- # => {:manifest=>nil, :bytes=>"1918", :content_type=>"application/octet-stream", :metadata=>{"foo"=>"bar, "herpa"=>"derp"}, :etag=>"1e5b089a1d92052bcf759d86465143f8", :last_modified=>"Tue, 17 Apr 2012 08:46:35 GMT"}
69
+ # => {:manifest=>nil, :bytes=>"1918", :content_type=>"application/octet-stream", :metadata=>{"foo"=>"bar, "herpa"=>"derp"}, :etag=>"1e5b089a1d92052bcf759d86465143f8", :last_modified=>"Tue, 17 Apr 2012 08:46:35 GMT", :cache_control=>nil}
68
70
  #
69
71
  def object_metadata
70
72
  path = "/#{@containername}/#{@name}"
@@ -74,6 +76,7 @@ module Swift
74
76
  :content_type=>resphash["content-type"][0],
75
77
  :last_modified=>resphash["last-modified"][0],
76
78
  :etag=>resphash["etag"][0],
79
+ :cache_control=> (resphash.has_key?("cache-control") ? resphash["cache-control"][0] : nil),
77
80
  :manifest=> (resphash.has_key?("x-object-manifest") ? resphash["x-object-manifest"][0] : nil),
78
81
  :metadata=>{}}
79
82
  resphash.inject({}){|res, (k,v)| meta[:metadata].merge!({ k.gsub("x-object-meta-", "") => v.first }) if k.match(/^x-object-meta-/)}
@@ -115,6 +118,13 @@ module Swift
115
118
  self.object_metadata[:content_type]
116
119
  end
117
120
 
121
+ # Cache-Control header of the object
122
+ # obj.cache_control
123
+ # => "application/json"
124
+ def cache_control
125
+ self.object_metadata[:cache_control]
126
+ end
127
+
118
128
  # Retrieves the data from an object and stores the data in memory. The data is returned as a string.
119
129
  # Throws a OpenStack::Exception::ItemNotFound if the object doesn't exist.
120
130
  #
@@ -12,7 +12,7 @@ module OpenStack
12
12
 
13
13
  def initialize(snap_info)
14
14
  @id = snap_info["id"]
15
- @display_name = snap_info["display_name"] || snap_info["displayName"]
15
+ @display_name = snap_info["display_name"] || snap_info["displayName"] || snap_info["name"]
16
16
  @display_description = snap_info["display_description"] || snap_info["displayDescription"]
17
17
  @volume_id = snap_info["volume_id"] || snap_info["volumeId"]
18
18
  @status = snap_info["status"]
@@ -28,7 +28,7 @@ module OpenStack
28
28
  end
29
29
 
30
30
  @id = volume_info["id"]
31
- @display_name = volume_info["display_name"] || volume_info["displayName"]
31
+ @display_name = volume_info["display_name"] || volume_info["displayName"] || volume_info["name"]
32
32
  @display_description = volume_info["display_description"] || volume_info["displayDescription"]
33
33
  @size = volume_info["size"]
34
34
  @volume_type = volume_info["volume_type"] || volume_info["volumeType"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.9
4
+ version: 3.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Prince