zcollective 0.0.12 → 0.0.13

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.
Files changed (3) hide show
  1. checksums.yaml +5 -13
  2. data/lib/zcollective/zabbixclient.rb +13 -1
  3. metadata +8 -8
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjM2YzRlNzJiMzJjOWJjMWVlNzk2MmVhZjU4OGNkMWEzMjNhYmJkMg==
5
- data.tar.gz: !binary |-
6
- ZjUyY2I3NGVjZDdkYTdmZjI5ZjFkZDE2MmRjZTViYjFlNmQ0ZTE0ZQ==
2
+ SHA1:
3
+ metadata.gz: 51945c4cff0bc6f23214c66bd43d680b9b3eaf75
4
+ data.tar.gz: 470cc4c6b69ff917e5b796efc389ae23d817dde5
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YjQyOTY5MTRkMTJlZjU4ZTkwNDlkMzY0OGQxNWNjNTE0OGNkN2UxNTkxZTY4
10
- ZDdhYmMxZDM0NDA0ZDM0ZTk0YTAzNTU0NTdmYjA4NGJlOTVkZjAzZmNkODNl
11
- MGVkY2RiNGQ0YzMwNTZmNjVlOTU1NzQ5YTc0OWI5ZTk2ODEwZTg=
12
- data.tar.gz: !binary |-
13
- OTQ4MmYyMWJmZWJmNWEzZTcwZGVkOThhYjUyNmIyZjNhODdmMzU5ZDZiODY0
14
- MTcyMTU5ZWFmYmQ5ZTE0Y2YyZDc1NmM1NjgzNzBiMGU1Y2RmMjVmMjk2ZmVk
15
- ZTA5NTZlZjIzNWQ2OTUyZjU0ZmU2NmRjMzUzYzMxZmZiZTEzMzc=
6
+ metadata.gz: d6e2feed9713e80f83d0a91cb6f18a23a9d4ca744a0222eb216450a3ca9e26479a0643b2a3f6f561b9fee054ccd1c716e734fa8dbe7ab87e1b782daeea420141
7
+ data.tar.gz: 9eb0f9c3ec16d6244fcb4cd904c599af94540cc81916cf2b0773b06ee0d8160687640cc0c3fea2c5be5da9d24f6afea6c9542461bf16abe547fd40688e9d2daa
@@ -38,6 +38,7 @@ module ZCollective
38
38
  @auth_hash
39
39
  @options
40
40
  @log
41
+ @version
41
42
 
42
43
  def initialize ( options = {} )
43
44
  @options = options
@@ -55,7 +56,18 @@ module ZCollective
55
56
 
56
57
  def authenticate ( )
57
58
 
58
- response = request( 'user.authenticate',
59
+ @version = request( 'apiinfo.version' )
60
+
61
+ major, minor, patch = @version.split('.')
62
+
63
+ # login method name changed after 2.0
64
+ if major.to_i >= 2 && minor.to_i > 0
65
+ login_method = 'user.login'
66
+ else
67
+ login.method = 'user.authenticate'
68
+ end
69
+
70
+ response = request( login_method,
59
71
  :user => @options[:user],
60
72
  :password => @options[:password]
61
73
  )
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zcollective
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Topper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-25 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: netaddr
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.5.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.5.0
27
27
  description: ZCollective is a tool used to configure Zabbix using data discovered
@@ -32,8 +32,8 @@ executables:
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - bin/zcollective
36
35
  - lib/zcollective/zabbixclient.rb
36
+ - bin/zcollective
37
37
  homepage: http://github.com/scalefactory/zcollective
38
38
  licenses: []
39
39
  metadata: {}
@@ -43,17 +43,17 @@ require_paths:
43
43
  - lib
44
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ! '>='
51
+ - - '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  requirements: []
55
55
  rubyforge_project:
56
- rubygems_version: 2.4.1
56
+ rubygems_version: 2.0.14
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Zabbix/MCollective integration