hiera-postgres-backend 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile.lock +1 -1
- data/hiera-postgres-backend.gemspec +1 -1
- data/lib/hiera/backend/postgres_backend.rb +15 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 579e8f9d6c45cca95af59718d95f56e5fe6837d7
|
4
|
+
data.tar.gz: 9207ad3377c7710fa02dc28cb356afa4e073f115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c9e91a44f9827794064ecc797c99d85b09cb20943122d1d5f28415deb4f4b19657d486cc405f3ea6d671026a1008134d4760819f52a5809b8e14fdae2ea350
|
7
|
+
data.tar.gz: 608cb8a8ce53224f2ce9690fcc4217d6bce406e3d390e2440a0f33e9bab98642366eb6bf96c55ba763d3d5c2e0f0b70fa51679f814ad39a8cea03b5fe5e8498f
|
data/.gitignore
ADDED
data/Gemfile.lock
CHANGED
@@ -20,7 +20,7 @@ class Hiera
|
|
20
20
|
# an Array of nils and causing a Puppet::Parser::AST::Resource failed with error ArgumentError
|
21
21
|
# for any other lookup because their default value is overwriten by [nil,nil,nil,nil]
|
22
22
|
# so hiera('myvalue', 'test1') returns [nil,nil,nil,nil]
|
23
|
-
|
23
|
+
answer = nil
|
24
24
|
|
25
25
|
Hiera.debug("looking up #{key} in PostgreSQL Backend")
|
26
26
|
Hiera.debug("resolution type is #{resolution_type}")
|
@@ -41,10 +41,22 @@ class Hiera
|
|
41
41
|
Hiera.debug("Found #{key} in #{source}")
|
42
42
|
|
43
43
|
new_answer = Backend.parse_answer(data[key], scope)
|
44
|
-
|
44
|
+
case resolution_type
|
45
|
+
when :array
|
46
|
+
raise Exception, "Hiera type mismatch: expected Array and got #{new_answer.class}" unless new_answer.kind_of? Array or new_answer.kind_of? String
|
47
|
+
answer ||= []
|
48
|
+
answer << query(new_answer)
|
49
|
+
when :hash
|
50
|
+
raise Exception, "Hiera type mismatch: expected Hash and got #{new_answer.class}" unless new_answer.kind_of? Hash
|
51
|
+
answer ||= {}
|
52
|
+
answer = Backend.merge_answer(query(new_answer),answer)
|
53
|
+
else
|
54
|
+
answer = query(new_answer)
|
55
|
+
break
|
56
|
+
end
|
45
57
|
|
46
58
|
end
|
47
|
-
return
|
59
|
+
return answer
|
48
60
|
end
|
49
61
|
|
50
62
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-postgres-backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -45,6 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- .gitignore
|
48
49
|
- Gemfile
|
49
50
|
- Gemfile.lock
|
50
51
|
- LICENSE
|