jerakia 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jerakia/cli.rb +19 -2
- data/lib/jerakia/log.rb +2 -3
- data/lib/jerakia/version.rb +1 -1
- data/lib/jerakia.rb +2 -1
- 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: f3e8936250f4d06c2553fe8569715bd13c94b58d
|
4
|
+
data.tar.gz: 807773e2bf5c2792e553ad5db456426938aa2348
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f5db5f4147dbc412eb503f812b30cc223a9e3f6464c5ce08b5bc9f398bf5dae76dbc42a271b03b067becfa742356093305a607c1f16eafe0105ba87eebff94
|
7
|
+
data.tar.gz: f21fc2d475838dbb4302c8bcb498a6e69eefec2e1aed6f27facbac5ef091ec5d16c74bdb4570f4cd66b1c612a42a79ff4bc21df9892bd3c27935c749b2712de8
|
data/lib/jerakia/cli.rb
CHANGED
@@ -37,19 +37,36 @@ class Jerakia
|
|
37
37
|
aliases: :l,
|
38
38
|
type: :string,
|
39
39
|
desc: 'Log level'
|
40
|
+
option :debug,
|
41
|
+
aliases: :D,
|
42
|
+
type: :boolean,
|
43
|
+
desc: 'Debug information to console, implies --log-level debug'
|
40
44
|
option :metadata,
|
41
45
|
aliases: :d,
|
42
46
|
type: :hash,
|
43
47
|
desc: 'Key/value pairs to be used as metadata for the lookup'
|
44
48
|
def lookup(key)
|
45
|
-
|
49
|
+
|
50
|
+
if options[:debug]
|
51
|
+
loglevel = "debug"
|
52
|
+
logfile = STDOUT
|
53
|
+
else
|
54
|
+
logfile = nil
|
55
|
+
loglevel = options[:log_level]
|
56
|
+
end
|
57
|
+
|
58
|
+
jac = Jerakia.new({
|
59
|
+
:config => options[:config],
|
60
|
+
:loglevel => options[:log_level],
|
61
|
+
:logfile => logfile,
|
62
|
+
:loglevel => loglevel,
|
63
|
+
})
|
46
64
|
req = Jerakia::Request.new(
|
47
65
|
:key => key,
|
48
66
|
:namespace => options[:namespace].split(/::/),
|
49
67
|
:policy => options[:policy].to_sym,
|
50
68
|
:lookup_type => options[:type].to_sym,
|
51
69
|
:merge => options[:merge_type].to_sym,
|
52
|
-
:loglevel => options[:log_level],
|
53
70
|
:metadata => options[:metadata]
|
54
71
|
)
|
55
72
|
|
data/lib/jerakia/log.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
class Jerakia::Log < Jerakia
|
2
2
|
|
3
3
|
require 'logger'
|
4
|
-
def initialize(level=:info)
|
5
|
-
@@
|
6
|
-
@@logger ||= Logger.new(@@logfile)
|
4
|
+
def initialize(level=:info,file='/var/log/jerakia.log')
|
5
|
+
@@logger ||= Logger.new(file)
|
7
6
|
@@level ||= level
|
8
7
|
case @@level
|
9
8
|
when :info
|
data/lib/jerakia/version.rb
CHANGED
data/lib/jerakia.rb
CHANGED
@@ -20,7 +20,8 @@ class Jerakia
|
|
20
20
|
|
21
21
|
@@filecache = {}
|
22
22
|
loglevel = options[:loglevel] || @@config["loglevel"] || "info"
|
23
|
-
|
23
|
+
logfile = options[:logfile] || @@config["logfile"] || "/var/log/jerakia.log"
|
24
|
+
@@log = Jerakia::Log.new(loglevel.to_sym, logfile)
|
24
25
|
@@log.debug("Jerakia initialized")
|
25
26
|
end
|
26
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jerakia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -80,7 +80,7 @@ files:
|
|
80
80
|
- lib/jerakia/version.rb
|
81
81
|
- lib/puppet/indirector/data_binding/jerakia.rb
|
82
82
|
- lib/puppet/indirector/data_binding/jerakia_rest.rb
|
83
|
-
homepage: http://
|
83
|
+
homepage: http://jerakia.io
|
84
84
|
licenses:
|
85
85
|
- Apache 2.0
|
86
86
|
metadata: {}
|