samanage 1.8.6 → 1.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +3 -0
- data/lib/samanage/api.rb +6 -5
- data/lib/samanage/version.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: e1dc65a5a8e92d420166469ca9959c5555e1538f
|
4
|
+
data.tar.gz: c15598bf31ea9488ba0d7f8897484bd0c0ad7756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db8cc22baef9596bcbb263be8c51efda54e5c99656fcc2b2825e98033c8342a69bf1795e1621f50a39b6159dcfeb46f6066cc4c32d095cc18a511d48cb9814ab
|
7
|
+
data.tar.gz: 33d2093ce8704852315ca18edcc9b40433da36f16c9453de3637bb737ca9663cdf79aeef2044484ab7ca0862349668378eb6c8278d203bcd06c51b8900c64066
|
data/changelog.md
CHANGED
data/lib/samanage/api.rb
CHANGED
@@ -16,12 +16,12 @@ module Samanage
|
|
16
16
|
user: 'users.json',
|
17
17
|
}
|
18
18
|
ssl_ca_file "#{File.expand_path('..')}/data/cacert.pem"
|
19
|
-
attr_accessor :datacenter, :content_type, :base_url, :token, :custom_forms, :authorized, :admins, :
|
19
|
+
attr_accessor :datacenter, :content_type, :base_url, :token, :custom_forms, :authorized, :admins, :max_retries
|
20
20
|
|
21
21
|
# Development mode forzes authorization & prepopulates custom forms/fields and admins
|
22
22
|
# datacenter should equal 'eu' or blank
|
23
23
|
def initialize(token: nil, datacenter: nil, development_mode: false, max_retries: MAX_RETRIES)
|
24
|
-
self.
|
24
|
+
self.max_retries = max_retries
|
25
25
|
self.token = token if token
|
26
26
|
if !datacenter.nil? && datacenter.to_s.downcase != 'eu'
|
27
27
|
datacenter = nil
|
@@ -78,6 +78,7 @@ module Samanage
|
|
78
78
|
payload: payload
|
79
79
|
}
|
80
80
|
full_path = self.base_url + path
|
81
|
+
retries = 0
|
81
82
|
begin
|
82
83
|
case http_method.to_s.downcase
|
83
84
|
when 'get'
|
@@ -89,9 +90,9 @@ module Samanage
|
|
89
90
|
end
|
90
91
|
rescue Errno::ECONNREFUSED, Net::OpenTimeout => e
|
91
92
|
puts "#{e} - #{e.class}"
|
92
|
-
puts "Retry: #{
|
93
|
-
|
94
|
-
retry if
|
93
|
+
puts "Retry: #{retries}/#{self.max_retries}"
|
94
|
+
retries += 1
|
95
|
+
retry if retries < self.max_retries
|
95
96
|
error = e
|
96
97
|
response = e.class
|
97
98
|
raise Samanage::InvalidRequest.new(error: error, response: response)
|
data/lib/samanage/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: samanage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Walls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|