miasma-azure 0.1.2 → 0.1.4
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/miasma-azure/version.rb +1 -1
- data/lib/miasma/contrib/azure.rb +17 -6
- data/lib/miasma/contrib/azure/orchestration.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54845db70434630e69c25a63e10818cb14511585
|
4
|
+
data.tar.gz: 4374a9268fb417fc67a7e900af2860b57aa66b60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95eeefb4dda75bf05d4a39e6da9a8cba99fc4b0b4c4d85c973896da6fec1cfadde130409e08fcd2daa0871032bfdd749e45c9910594187f2f4d513a0969535ba
|
7
|
+
data.tar.gz: 7e16ed8ffd66ef61fa5af9af47a887b1cf497961f35e62c9ff035b94c448aa30120d14827c07802c0e02f2c8640e3b1698210f9d5b7d148b1912be89c18408e5
|
data/CHANGELOG.md
CHANGED
data/lib/miasma-azure/version.rb
CHANGED
data/lib/miasma/contrib/azure.rb
CHANGED
@@ -317,7 +317,7 @@ module Miasma
|
|
317
317
|
|
318
318
|
def request_client_token
|
319
319
|
result = HTTP.post(
|
320
|
-
|
320
|
+
[azure_login_url, azure_tenant_id, 'oauth2', 'token'].join('/'),
|
321
321
|
:form => {
|
322
322
|
:grant_type => 'client_credentials',
|
323
323
|
:client_id => azure_client_id,
|
@@ -326,11 +326,10 @@ module Miasma
|
|
326
326
|
}
|
327
327
|
)
|
328
328
|
unless(result.code == 200)
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
raise 'ACK'
|
329
|
+
raise Miasma::Error::ApiError.new(
|
330
|
+
'Request for client authentication token failed',
|
331
|
+
:response => result
|
332
|
+
)
|
334
333
|
end
|
335
334
|
@oauth_token_information = MultiJson.load(
|
336
335
|
result.body.to_s
|
@@ -348,6 +347,18 @@ module Miasma
|
|
348
347
|
end
|
349
348
|
end
|
350
349
|
|
350
|
+
# Define when request should be retried
|
351
|
+
#
|
352
|
+
# @param exception [Exception]
|
353
|
+
# @return [TrueClass, FalseClass]
|
354
|
+
def perform_request_retry(exception)
|
355
|
+
if(exception.is_a?(Error::ApiError::RequestError))
|
356
|
+
exception.response.code >= 500
|
357
|
+
else
|
358
|
+
false
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
351
362
|
# @return [String] custom escape
|
352
363
|
def uri_escape(string)
|
353
364
|
signer.safe_escape(string)
|
@@ -436,7 +436,7 @@ module Miasma
|
|
436
436
|
:resource_logical_id => event.get(:properties, :targetResource, :resourceName),
|
437
437
|
:resource_state => status_to_state(event.get(:properties, :provisioningState)),
|
438
438
|
:resource_status => event.get(:properties, :provisioningState),
|
439
|
-
:resource_status_reason => event.get(:properties, :statusCode),
|
439
|
+
:resource_status_reason => event.get(:properties, :statusCode).to_s,
|
440
440
|
:time => Time.parse(event.get(:properties, :timestamp))
|
441
441
|
).valid_state
|
442
442
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miasma-azure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: miasma
|