hiera-router 0.2.0 → 0.2.1
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/router_backend.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3b791b3292b848979608328b58dfc7dd60b136
|
4
|
+
data.tar.gz: 564e4ed4c0b8fb62fedf0be30e08ab73c6c083ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0acd0d7e6cb93b8731c19c43b0360d32f686ec9f2772ed9987e04608da18c089bfe5edcc030ab13a4f6be5f8702c8c4df053ed4f777118dc51811bfdee0c223a
|
7
|
+
data.tar.gz: 70069df8815d3435ac3b043174c7feee02ba39b6efadc0d319471af6a6165b6e05bcc32e945682cd564be8c44221706f7c31d59954a40f50cff7e5e2f6b6d64f
|
@@ -18,7 +18,7 @@ class Hiera
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
Hiera.debug("hiera router initialized")
|
21
|
+
Hiera.debug("[hiera-router] hiera router initialized")
|
22
22
|
end
|
23
23
|
def lookup(key, scope, order_override, resolution_type)
|
24
24
|
options = {
|
@@ -29,10 +29,10 @@ class Hiera
|
|
29
29
|
}
|
30
30
|
answer = nil
|
31
31
|
|
32
|
-
Hiera.debug("Looking up #{key} in yaml backend")
|
32
|
+
Hiera.debug("[hiera-router] Looking up #{key} in yaml backend")
|
33
33
|
|
34
34
|
Backend.datasources(scope, order_override) do |source|
|
35
|
-
Hiera.debug("Looking for data source #{source}")
|
35
|
+
Hiera.debug("[hiera-router] Looking for data source #{source}")
|
36
36
|
yaml_file = Backend.datafile(:router, scope, source, 'yaml') || next
|
37
37
|
|
38
38
|
next unless File.exists?(yaml_file)
|
@@ -44,7 +44,7 @@ class Hiera
|
|
44
44
|
next if data.empty?
|
45
45
|
next unless data.include?(key)
|
46
46
|
|
47
|
-
Hiera.debug("Found #{key} in #{source}")
|
47
|
+
Hiera.debug("[hiera-router] Found #{key} in #{source}")
|
48
48
|
|
49
49
|
new_answer = parse_answer(data[key], scope, options)
|
50
50
|
next if new_answer.nil?
|
@@ -95,14 +95,14 @@ class Hiera
|
|
95
95
|
backend_name, backend_parameters = match.captures
|
96
96
|
backend_options = options
|
97
97
|
backend_options = backend_options.merge(backend_parameters) if backend_parameters
|
98
|
-
Hiera.debug
|
98
|
+
Hiera.debug("[hiera-router] Calling hiera with '#{backend_name}'...")
|
99
99
|
if backend = backends[backend_name]
|
100
100
|
result = backend.lookup(backend_options[:key], backend_options[:scope], nil, backend_options[:resolution_type])
|
101
101
|
else
|
102
102
|
Hiera.warn "Backend '#{backend_name}' was not configured; returning the data as-is."
|
103
103
|
result = data
|
104
104
|
end
|
105
|
-
Hiera.debug
|
105
|
+
Hiera.debug("[hiera-router] Call to '#{backend_name}' finished.")
|
106
106
|
return result
|
107
107
|
else
|
108
108
|
Backend.parse_string(data, scope)
|