fluent-plugin-azurestorage 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 173125873d3f72fb76b104b180df63b23472c02d
4
- data.tar.gz: 4895ded3228acfb7c5e3e6458f9cc081c0ce69da
3
+ metadata.gz: ce8aaa474c1875c0197fc1a0c9c5c410e07ecc45
4
+ data.tar.gz: ec0e86655884f80c7a4074193f1e3dd9fa502219
5
5
  SHA512:
6
- metadata.gz: 87d07b8903865caccf0e90833cbbc5edf9fb4ac81bcf453e526d9b3555a0c92af0aff6abee645abdab4789ecdd98ede4cfcaddc0c53e1b0eadb6c905f71585e8
7
- data.tar.gz: 12b97072aa1633a683b7061212f6ac7a7c3c30c5374f9068edac973ab4972cbb086f4397c58e35a95d2dbf26ff20febd883f8ec0d91d8e181505c1a296fb17c7
6
+ metadata.gz: 5be469b9803ce3003d9e6cad34868fcd1044f6ff5892cb83114e369436199ee7ed05683608c56d57853859d3e9c772a94cb2f9bf48d48d67785e9ee20c8fc788
7
+ data.tar.gz: 6b515d709d7ead762182eaf7b5fc20e8130532998fdd59179d7ecabba8a9945573e5b5e9b40061fbd46fd9adbf53183a3e78682cf53d925de5e1fd7c90e3e270
@@ -4,7 +4,7 @@
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-azurestorage"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.2"
8
8
  spec.authors = ["Hidemasa Togashi"]
9
9
  spec.email = ["togachiro@gmail.com"]
10
10
  spec.description = %q{Fluent plugin for store to Azure Storage}
@@ -26,6 +26,10 @@ module Fluent
26
26
 
27
27
  include Fluent::Mixin::ConfigPlaceholders
28
28
 
29
+ def placeholders
30
+ [:percent]
31
+ end
32
+
29
33
  def configure(conf)
30
34
  super
31
35
 
@@ -92,7 +96,6 @@ module Fluent
92
96
  end
93
97
 
94
98
  def write(chunk)
95
- blob_list = @bs.list_blobs(@azure_container)
96
99
  i = 0
97
100
  begin
98
101
  path = @path_slicer.call(@path)
@@ -106,7 +109,7 @@ module Fluent
106
109
  values_for_object_key[expr[2...expr.size-1]]
107
110
  }
108
111
  i += 1
109
- end while blob_list.find { |elem| elem.name == storage_path }
112
+ end while blob_exists?(@azure_container, storage_path)
110
113
 
111
114
  tmp = Tempfile.new("azure-")
112
115
  begin
@@ -158,5 +161,17 @@ module Fluent
158
161
  raise ConfigError, "'#{command}' utility must be in PATH for #{algo} compression"
159
162
  end
160
163
  end
164
+
165
+ def blob_exists?(container, blob)
166
+ begin
167
+ @bs.get_blob_properties(container, blob)
168
+ true
169
+ rescue Azure::Core::Http::HTTPError => ex
170
+ raise if ex.status_code != 404
171
+ false
172
+ rescue Exception => e
173
+ raise e.message
174
+ end
175
+ end
161
176
  end
162
177
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-azurestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hidemasa Togashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-03 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler