jerakia 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiera/backend/jerakia_backend.rb +5 -2
- data/lib/jerakia/cli.rb +14 -9
- data/lib/jerakia/policy.rb +1 -2
- data/lib/jerakia/version.rb +1 -1
- data/lib/puppet/indirector/data_binding/jerakia.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 691dd2bc7adfbd791cfff7d5e1e81721567d0684
|
4
|
+
data.tar.gz: 987421a97b12e0803be5562656d5c92b916ae326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e6dab70dc4cd75bd53a8e697c2dbca44a2de610f99d9f1da6875cd8b6a788caa9d2ab3ec4cd9367a1379929dc88b2e04caa3758eda7622b9097c410f8634764
|
7
|
+
data.tar.gz: acf4f2caacbbdd93d65a7225b7f1ae1777e4398993b23dd05e0ba6be5af6bd9dcc7eae2a9cb080916b6cacf2439481f7f3a435ea2d25ba5f453ab77f6b5576b2
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'puppet'
|
2
|
+
require 'puppet/resource'
|
3
|
+
|
1
4
|
class Hiera
|
2
5
|
module Backend
|
3
6
|
class Jerakia_backend
|
@@ -35,9 +38,9 @@ class Hiera
|
|
35
38
|
|
36
39
|
metadata={}
|
37
40
|
if scope.is_a?(Hash)
|
38
|
-
metadata=scope
|
41
|
+
metadata=scope.reject { |k, v| v.is_a?(Puppet::Resource) }
|
39
42
|
else
|
40
|
-
metadata = scope.real.to_hash
|
43
|
+
metadata = scope.real.to_hash.reject { |k, v| v.is_a?(Puppet::Resource) }
|
41
44
|
end
|
42
45
|
|
43
46
|
request = Jerakia::Request.new(
|
data/lib/jerakia/cli.rb
CHANGED
@@ -70,6 +70,11 @@ class Jerakia
|
|
70
70
|
|
71
71
|
|
72
72
|
def lookup(key)
|
73
|
+
# Thor by default now returns a frozen options hash so we
|
74
|
+
# need to dup this here to prevent problems later with
|
75
|
+
# modifying the request object
|
76
|
+
#
|
77
|
+
options_copy = options.dup
|
73
78
|
|
74
79
|
case true
|
75
80
|
when options[:verbose]
|
@@ -92,15 +97,15 @@ class Jerakia
|
|
92
97
|
:trace => options[:trace],
|
93
98
|
})
|
94
99
|
req = Jerakia::Request.new(
|
95
|
-
:key => key,
|
96
|
-
:namespace =>
|
97
|
-
:policy =>
|
98
|
-
:lookup_type =>
|
99
|
-
:merge =>
|
100
|
-
:metadata =>
|
101
|
-
:scope =>
|
102
|
-
:scope_options =>
|
103
|
-
:use_schema =>
|
100
|
+
:key => key.dup,
|
101
|
+
:namespace => options_copy[:namespace].split(/::/),
|
102
|
+
:policy => options_copy[:policy].to_sym,
|
103
|
+
:lookup_type => options_copy[:type].to_sym,
|
104
|
+
:merge => options_copy[:merge_type].to_sym,
|
105
|
+
:metadata => options_copy[:metadata] || {},
|
106
|
+
:scope => options_copy[:scope].to_sym,
|
107
|
+
:scope_options => options_copy[:scope_options],
|
108
|
+
:use_schema => options_copy[:schema],
|
104
109
|
)
|
105
110
|
|
106
111
|
|
data/lib/jerakia/policy.rb
CHANGED
data/lib/jerakia/version.rb
CHANGED
@@ -19,7 +19,7 @@ class Puppet::DataBinding::Jerakia < Puppet::Indirector::Code
|
|
19
19
|
lookupdata=request.key.split(/::/)
|
20
20
|
key=lookupdata.pop
|
21
21
|
namespace=lookupdata
|
22
|
-
metadata = request.options[:variables].to_hash
|
22
|
+
metadata = request.options[:variables].to_hash.reject { |k, v| v.is_a?(Puppet::Resource) }
|
23
23
|
policy=metadata["jerakia_policy"] || @default_policy
|
24
24
|
jacreq = Jerakia::Request.new(
|
25
25
|
:key => key,
|
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: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|