samanage 2.0.03 → 2.0.04
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 +2 -3
- data/lib/samanage/api/groups.rb +1 -0
- data/lib/samanage/api/users.rb +1 -1
- 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: 6796c0452edb120a072eadd8d55ff98d15a77fa2
|
4
|
+
data.tar.gz: bed930df46217b9753bb0cae74c4e69b6aa0597a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44c4c9086e8f0374e64d43811ff9803ec9c9d98486d6f9c23bbfb67fcf0da9730c7af495558d4df611fbe731b8b00b701cd4d48f0d822caeae12f9497027088f
|
7
|
+
data.tar.gz: 349755503dfb098afb2efea97ded9e594a568f035d7c9b5c322c94dd49fa514367876e7912302ecc57111add1bee1cd89d601c5dbd87edde137b5ac8d5c1a27b
|
data/changelog.md
CHANGED
data/lib/samanage/api.rb
CHANGED
@@ -91,7 +91,7 @@ module Samanage
|
|
91
91
|
raise Samanage::Error.new(response: {response: 'Unknown HTTP method'})
|
92
92
|
end
|
93
93
|
rescue Errno::ECONNREFUSED, Net::OpenTimeout, Errno::ETIMEDOUT, OpenSSL::SSL::SSLError => e
|
94
|
-
puts "
|
94
|
+
puts "[Warning]#{e.class}: #{e} - Retry: #{retries}/#{self.max_retries}"
|
95
95
|
sleep 3
|
96
96
|
retries += 1
|
97
97
|
retry if retries < self.max_retries
|
@@ -116,8 +116,7 @@ module Samanage
|
|
116
116
|
response[:data] = JSON.parse(api_call.body)
|
117
117
|
rescue JSON::ParserError => e
|
118
118
|
response[:data] = api_call.body
|
119
|
-
puts "
|
120
|
-
puts e
|
119
|
+
puts "[Warning] #{e.class}: #{e}"
|
121
120
|
end
|
122
121
|
response
|
123
122
|
when 401
|
data/lib/samanage/api/groups.rb
CHANGED
@@ -26,6 +26,7 @@ module Samanage
|
|
26
26
|
|
27
27
|
def find_group_id_by_name(group: )
|
28
28
|
group_api = self.execute(path: "groups.json?name=#{group}")
|
29
|
+
# Group names are case sensitive
|
29
30
|
if !group_api[:data].empty? && group == group_api[:data].first['name']
|
30
31
|
return group_api[:data].first['id']
|
31
32
|
end
|
data/lib/samanage/api/users.rb
CHANGED
@@ -46,7 +46,7 @@ module Samanage
|
|
46
46
|
group_ids = user[:data].select{|u| u['email'].to_s.downcase == email.to_s.downcase}.first.to_h['group_ids'].to_a
|
47
47
|
group_ids.each do |group_id|
|
48
48
|
group = self.find_group(id: group_id)
|
49
|
-
if group[:data]['is_user'] && email == group[:data]['email']
|
49
|
+
if group[:data]['is_user'] && email.to_s.downcase == group[:data]['email'].to_s.downcase
|
50
50
|
return group_id
|
51
51
|
end
|
52
52
|
end
|
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: 2.0.
|
4
|
+
version: 2.0.04
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Walls
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|