pushmi_pullyu 0.2.5 → 0.2.6

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: cebf127f72bad169df1e6834e6eda708337f4a6f
4
- data.tar.gz: 2e9e0cdb1e68e742434a42ef7fa0daa2e2ca8d1e
3
+ metadata.gz: 0f283beb86e53c87da86178c6378da2522d41703
4
+ data.tar.gz: 629475e07add284c7af575932d6400af1ec7c50a
5
5
  SHA512:
6
- metadata.gz: 8e8c880d6f0f752dcc3029b173b76e73b1655b892f3f17305a8a88ee8158ef69261b82d7e5d94c00bfed6a456921bf149233efcaf270170b20363aa6c2a9cf8c
7
- data.tar.gz: f67239021556d8aa74701bcc5bfdf312909f96b134fb0f4d04a7b9f261e8879a98cc22f0b28808986d2338f83eae699594dc8f6731af9ac5d3fbd71c39c2effa
6
+ metadata.gz: d6606eb7bceef18a1a263f8e0f5ff6adc86f6d46b13a8e34ac4f3867ace42b91e9e71a00c794b1bd29a1a7a9b3dd8caae46cd1261ec988b4f6fd386644fda598
7
+ data.tar.gz: d8987510e6d8e4e99e27c38f49cddca65fe2cdbf17b28b0395503cb540698867065e36d43291897e4488f8e8bfc33444bc4a049f1abf52cbd52f1a438127c0d4
@@ -37,13 +37,21 @@ class PushmiPullyu::SwiftDepositer
37
37
  # ruby-openstack wants all keys of the metadata to be named like "X-Object-Meta-{{Key}}", so update them
38
38
  metadata.transform_keys! { |key| "X-Object-Meta-#{key}" }
39
39
 
40
- headers = { 'etag' => checksum,
41
- 'content-type' => 'application/x-tar' }.merge(metadata)
42
-
40
+ # ruby-openstack expects the header hash in different structure for write vs create_object methods
41
+ # details see: https://github.com/ualbertalib/pushmi_pullyu/issues/105
43
42
  if era_container.object_exists?(file_base_name)
43
+ # temporary solution until fixed in upstream:
44
+ # for update: construct hash for key/value pairs as strings,
45
+ # and metadata as additional key/value string pairs in the hash
46
+ headers = { 'etag' => checksum,
47
+ 'content-type' => 'application/x-tar' }.merge(metadata)
44
48
  deposited_file = era_container.object(file_base_name)
45
49
  deposited_file.write(File.open(file_name), headers)
46
50
  else
51
+ # for creating new: construct hash with symbols as keys, add metadata as a hash within the header hash
52
+ headers = { etag: checksum,
53
+ content_type: 'application/x-tar',
54
+ metadata: metadata }
47
55
  deposited_file = era_container.create_object(file_base_name, headers, File.open(file_name))
48
56
  end
49
57
 
@@ -1,3 +1,3 @@
1
1
  module PushmiPullyu
2
- VERSION = '0.2.5'.freeze
2
+ VERSION = '0.2.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushmi_pullyu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Murnaghan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport