zabbixapi 0.5.1b15 → 0.5.1
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.
|
@@ -10,8 +10,6 @@ class ZabbixApi
|
|
|
10
10
|
b_new = normalize_hash(b)
|
|
11
11
|
hash1 = a_new.merge(b_new)
|
|
12
12
|
hash2 = b_new.merge(a_new)
|
|
13
|
-
log("hash1 == #{hash1}")
|
|
14
|
-
log("hash2 == #{hash2}")
|
|
15
13
|
hash1 == hash2
|
|
16
14
|
end
|
|
17
15
|
|
|
@@ -23,7 +21,7 @@ class ZabbixApi
|
|
|
23
21
|
|
|
24
22
|
def normalize_hash(hash)
|
|
25
23
|
result = hash.dup
|
|
26
|
-
result.delete(:hostid)
|
|
24
|
+
result.delete(:hostid) #TODO remove to logig. TemplateID and HostID has different id
|
|
27
25
|
result.each do |key, value|
|
|
28
26
|
case value
|
|
29
27
|
when Array
|
|
@@ -25,8 +25,7 @@ class ZabbixApi
|
|
|
25
25
|
id ? update(data.merge(key.to_sym => id.to_s)) : create(data)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
def update(data)
|
|
29
|
-
|
|
28
|
+
def update(data)
|
|
30
29
|
log "[DEBUG] Call update with parametrs: #{data.inspect}"
|
|
31
30
|
|
|
32
31
|
dump = {}
|
|
@@ -35,8 +34,8 @@ class ZabbixApi
|
|
|
35
34
|
dump = symbolize_keys(item) if item[key].to_i == data[key.to_sym].to_i
|
|
36
35
|
end
|
|
37
36
|
|
|
38
|
-
if hash_equals?(dump, data)
|
|
39
|
-
log "
|
|
37
|
+
if hash_equals?(dump, data)
|
|
38
|
+
log "[DEBUG] Equal keys #{dump} and #{data}, skip update"
|
|
40
39
|
item_id
|
|
41
40
|
else
|
|
42
41
|
data_update = array_flag ? [data] : data
|
data/lib/zabbixapi/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zabbixapi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 0.5.1
|
|
5
|
+
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
8
8
|
- Vasiliev D.V.
|
|
@@ -79,13 +79,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
79
79
|
version: '0'
|
|
80
80
|
segments:
|
|
81
81
|
- 0
|
|
82
|
-
hash:
|
|
82
|
+
hash: 3727156722468348692
|
|
83
83
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
none: false
|
|
85
85
|
requirements:
|
|
86
|
-
- - ! '
|
|
86
|
+
- - ! '>='
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version:
|
|
88
|
+
version: '0'
|
|
89
89
|
requirements: []
|
|
90
90
|
rubyforge_project: zabbixapi
|
|
91
91
|
rubygems_version: 1.8.24
|