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 +4 -4
- data/.gitignore +3 -3
- data/lib/salt_client.rb +10 -9
- data/lib/salt_client/version.rb +1 -1
- data/salt_client.gemspec +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9c965dd22309047d1ec5eabe8a35baa6e624e8d
|
4
|
+
data.tar.gz: 34c2ec2cfd563d3a0098b6f61d4ef0093315fe8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
-
|
41
|
+
raise("Something went wrong when calling your method")
|
41
42
|
end
|
42
43
|
|
43
44
|
response.body["return"][0]
|
data/lib/salt_client/version.rb
CHANGED
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.
|
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-
|
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:
|
86
|
+
version: 2.2.0
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
89
|
- - ">="
|