hiera-router 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hiera/backend/router_backend.rb +6 -0
- 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: 023ee55896165f33ed84b731bef890830e7ed256
|
4
|
+
data.tar.gz: a329d950ed6ef8ee233fd1745ef48aa316f26360
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cce9e57acfb306ca0424eb893bdae590c07523a42bb20adbb26d1d2eff0acfa680075d80230ae0be9509748cabf5fe5d39f87e752ea3341136963fd9fdb0190
|
7
|
+
data.tar.gz: 3605c01d65bb94a0aec630cf4096b9fa02326255c96672a69738b759798643f0df066c0d41a85f46c39c555d38c1d3eddbd252b649b59652da74d48e539d71bf
|
@@ -15,6 +15,10 @@ class Hiera
|
|
15
15
|
attr_reader :backends
|
16
16
|
attr_accessor :config
|
17
17
|
|
18
|
+
def symbolize_keys(hash)
|
19
|
+
hash.each_with_object({}) { |(k, v), h| h[k.to_sym] = v.is_a?(Hash) ? symbolize_keys(v) : v }
|
20
|
+
end
|
21
|
+
|
18
22
|
def initialize(cache = nil)
|
19
23
|
@cache = cache || Filecache.new
|
20
24
|
@backends = {}
|
@@ -40,6 +44,7 @@ class Hiera
|
|
40
44
|
|
41
45
|
backend_config[:backends] = [backend_classname]
|
42
46
|
backend_config[backend_classname.to_sym] = backend_config_override_config
|
47
|
+
backend_config = symbolize_keys(backend_config)
|
43
48
|
|
44
49
|
Config.load(backend_config)
|
45
50
|
require "hiera/backend/#{full_backend_classname.downcase}"
|
@@ -52,6 +57,7 @@ class Hiera
|
|
52
57
|
end
|
53
58
|
end
|
54
59
|
|
60
|
+
puts @backends.to_yaml
|
55
61
|
Hiera.debug("[hiera-router] hiera router initialized")
|
56
62
|
end
|
57
63
|
def lookup(key, scope, order_override, resolution_type)
|