salt_client 0.1.3 → 0.1.4

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: d2d1aadd97683ac3264af38a9a83a7de2f584448
4
- data.tar.gz: 0e0a8f6d3615d217e7c04d903b776e8b0b658e0d
3
+ metadata.gz: c9c965dd22309047d1ec5eabe8a35baa6e624e8d
4
+ data.tar.gz: 34c2ec2cfd563d3a0098b6f61d4ef0093315fe8a
5
5
  SHA512:
6
- metadata.gz: fd2e11becc7da960eb752c1dcdbd964c2a375211d8951451f535ba2bca2813b48fdcaa02b974f228271c509a4802e0410c4bb0b216cc82e790e67fc47d34438b
7
- data.tar.gz: f201b8ec3deb3de65a1a99416141fc05ba678e0b49695cd6e1ce9100722bca599d08dd9314a615b1029ec756499673c9d0fef80b5a283b872dbc395cda8905b3
6
+ metadata.gz: 74d8fc1d0ac76c92abab336e8e34dfa3d09a09d5effc598d75c2a52022ba5b43a8ce485f4333c1591af7280d9392fd0ceb06ebdcdf5f94eee8bfcb6e8e61303e
7
+ data.tar.gz: 11715736098baf28cba53ac46ac123c235971989abc577865b6670e747774be83f8e8f8c6c90f7fa128d5742d9b3ab70ea66bec3e5405ee56417aae0831cb8e7
data/.gitignore CHANGED
@@ -27,9 +27,9 @@ build/
27
27
 
28
28
  # for a library or gem, you might want to ignore these files since the code is
29
29
  # intended to run in multiple environments; otherwise, check them in:
30
- # Gemfile.lock
31
- # .ruby-version
32
- # .ruby-gemset
30
+ Gemfile.lock
31
+ .ruby-version
32
+ .ruby-gemset
33
33
 
34
34
  # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
35
35
  .rvmrc
data/lib/salt_client.rb CHANGED
@@ -16,28 +16,29 @@ module SaltClient
16
16
  }
17
17
 
18
18
  if response.code != 200
19
- abort("Could not login to the salt master")
19
+ raise("Could not login to the salt master")
20
20
  end
21
21
 
22
22
  @token = response.body.fetch("return")[0]["token"]
23
23
  end
24
24
 
25
25
  def call(target, function, arguments)
26
+ parameters = {
27
+ client: "local",
28
+ tgt: target,
29
+ fun: function
30
+ }
31
+ parameters[:arg] = arguments if arguments
32
+
26
33
  response = Unirest.post @server,
27
34
  headers: {
28
35
  "Accept": "application/json",
29
36
  "X-Auth-Token": @token
30
37
  },
31
- parameters: {
32
- :client => "local",
33
- :tgt => target,
34
- :fun => function,
35
- :arg => arguments,
36
- :expr_form => "grain"
37
- }
38
+ parameters: parameters
38
39
 
39
40
  if response.code != 200
40
- abort("Something went wrong when calling your method")
41
+ raise("Something went wrong when calling your method")
41
42
  end
42
43
 
43
44
  response.body["return"][0]
@@ -1,3 +1,3 @@
1
1
  module SaltClient
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/salt_client.gemspec CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.required_ruby_version = '>= 2.2.0'
22
+
21
23
  spec.add_dependency "unirest", "~> 1.1"
22
24
 
23
25
  spec.add_development_dependency "bundler", "~> 1.8"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salt_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Bularca
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unirest
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: '0'
86
+ version: 2.2.0
87
87
  required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - ">="