miasma 0.2.28 → 0.2.30

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: 3b2d18aa4668b4cd91f5d0c98895983fbded4a0d
4
- data.tar.gz: 203bbd13208a023c62f71d6c30d034df3043af82
3
+ metadata.gz: c9d47952cbfd15fb3a57ddfd6103c5024a689456
4
+ data.tar.gz: 5a06b29d9f76fae06e9ee1cc2ee5343eb0bfd948
5
5
  SHA512:
6
- metadata.gz: 5ff97e15e0702de0fb9606bcba54de85730416d666235dfe70050d2a19c2d88202d70228e511fbd5626d0b4d575fb82d06b09b27ecdba5452c7f507e1c63b2eb
7
- data.tar.gz: c8873ed07fb88bf5375f1b2f2db2f21647dbf22bfcdc1e0d7f1a1f6dd663f1299fcc2191bfc9eb1f74b952f6a7795616bb15c7985af50d8beccc1b40939fbfee
6
+ metadata.gz: 8b78609a2d1cb7150337f29ed0dada0c69f9274d7407f83fde98c23b8bd13e5e648fd2cdc1059968687b4d45009d8a0038720f8260483691cc462a181893fb1e
7
+ data.tar.gz: 8fc58eb0e34295f1bd04e0f693ac0a2a540e52ad246d27d372b4e0c1483c78b47d8311cc06960dba7defcdbc5d67b9ee096816106cca8abbbcf59da0a9e3f044
@@ -1,3 +1,6 @@
1
+ # v0.2.30
2
+ * Provide interface for API implementations to customize retry behavior
3
+
1
4
  # v0.2.28
2
5
  * Include original exception information on API load failures
3
6
  * Provide better retry functionality on non-modify requests
@@ -13,7 +13,10 @@ module Miasma
13
13
 
14
14
  ## mapping example
15
15
  # RESOURCE_MAPPING = Smash.new(
16
- # 'AWS::EC2::Instance' => Miasma::Models::Compute::Server
16
+ # 'AWS::EC2::Instance' => Smash.new(
17
+ # :api => :compute,
18
+ # :collection => :servers
19
+ # )
17
20
  # )
18
21
 
19
22
  # @return [Array<Symbol>] valid resource states
@@ -128,12 +128,28 @@ module Miasma
128
128
  def retryable_request(http_method, &block)
129
129
  Bogo::Retry.build(
130
130
  data.fetch(:retry_type, :exponential),
131
- :max_attempts => VALID_REQUEST_RETRY_METHODS.include?(http_method) ? data.fetch(:retry_max, MAX_REQUEST_RETRIES) : 1,
131
+ :max_attempts => retryable_allowed?(http_method) ? data.fetch(:retry_max, MAX_REQUEST_RETRIES) : 0,
132
132
  :wait_interval => data[:retry_interval],
133
133
  :ui => data[:retry_ui],
134
134
  :auto_run => false,
135
135
  &block
136
- ).run!
136
+ ).run!{|e| perform_request_retry(e) }
137
+ end
138
+
139
+ # Determine if request type is allowed to be retried
140
+ #
141
+ # @param http_method [Symbol] request type
142
+ # @return [TrueClass, FalseClass]
143
+ def retryable_allowed?(http_method)
144
+ VALID_REQUEST_RETRY_METHODS.include?(http_method)
145
+ end
146
+
147
+ # Determine if a retry on the request should be performed
148
+ #
149
+ # @param exception [Exception]
150
+ # @return [TrueClass, FalseClass]
151
+ def perform_request_retry(exception)
152
+ true
137
153
  end
138
154
 
139
155
  # Perform request
@@ -1,4 +1,4 @@
1
1
  module Miasma
2
2
  # current library version
3
- VERSION = Gem::Version.new('0.2.28')
3
+ VERSION = Gem::Version.new('0.2.30')
4
4
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.add_runtime_dependency 'multi_json'
15
15
  s.add_runtime_dependency 'multi_xml'
16
16
  s.add_runtime_dependency 'xml-simple'
17
- s.add_runtime_dependency 'bogo', '>= 0.1.27', '< 1.0'
17
+ s.add_runtime_dependency 'bogo', '>= 0.1.30', '< 1.0'
18
18
  # Include provider libs that do not have outside deps
19
19
  s.add_runtime_dependency 'miasma-aws'
20
20
  s.add_runtime_dependency 'miasma-open-stack'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miasma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.28
4
+ version: 0.2.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2015-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -72,7 +72,7 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.27
75
+ version: 0.1.30
76
76
  - - "<"
77
77
  - !ruby/object:Gem::Version
78
78
  version: '1.0'
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 0.1.27
85
+ version: 0.1.30
86
86
  - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.0'