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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d50b17cbf967d11c283e611f81604dbaa706a2e
4
- data.tar.gz: 431c0c26fbceb0b2f7ad044b94437ca36c00fd11
3
+ metadata.gz: 6796c0452edb120a072eadd8d55ff98d15a77fa2
4
+ data.tar.gz: bed930df46217b9753bb0cae74c4e69b6aa0597a
5
5
  SHA512:
6
- metadata.gz: ff9a40bd713209bb3f37b22bf7b6ff93b7a57e3074e92e9c27e0b21c27f127061b9865d3da7b2c8de2dedbe3feafdee7948cc304238416c677c2512815136e2d
7
- data.tar.gz: cdd09ce93a1200a5335dadbc0997792f0e8a93f07fa72abe188fd2063fb9f2e2ae7067334ce8ac4a3a716b5910371269b490827bdd407b59011f0b767320fdc0
6
+ metadata.gz: 44c4c9086e8f0374e64d43811ff9803ec9c9d98486d6f9c23bbfb67fcf0da9730c7af495558d4df611fbe731b8b00b701cd4d48f0d822caeae12f9497027088f
7
+ data.tar.gz: 349755503dfb098afb2efea97ded9e594a568f035d7c9b5c322c94dd49fa514367876e7912302ecc57111add1bee1cd89d601c5dbd87edde137b5ac8d5c1a27b
@@ -1,3 +1,6 @@
1
+ # 2.0.04
2
+ - Fix case sensitivity relationships
3
+
1
4
  # 2.0.03
2
5
  - Bugfix for custom fields (fix httparty version)
3
6
 
@@ -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 "Error:[#{e.class}] #{e} - Retry: #{retries}/#{self.max_retries}"
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 "** Warning **#{e.class}"
120
- puts e
119
+ puts "[Warning] #{e.class}: #{e}"
121
120
  end
122
121
  response
123
122
  when 401
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Samanage
2
- VERSION = '2.0.03'
2
+ VERSION = '2.0.04'
3
3
  end
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.03
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-02-27 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty