hiera-mysql-backend 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/hiera-mysql-backend.gemspec +2 -1
- data/lib/hiera/backend/mysql2_backend.rb +12 -10
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 457778db31cd7a5a4f02ffa77800a84db23db015
|
4
|
+
data.tar.gz: c816cf244a6dbe69476701fc0d4bc535a171f04b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20ba1b125177932546f88f9dab29a04c042194f2ea98e2ba092fb30824649ad25b60de4ce1a1f3740ebfb5e217f933a2cfed3ae78daadb4700f21a4020cb3aaf
|
7
|
+
data.tar.gz: 82baa75051114666b65f57c025c9747d80903b1b11fb087251e50dd88cbd2621a90a3472b72b789a91ce5d8847c18c36c66ab6baca4ef3a5e148dd014d1f0e09
|
data/README.md
CHANGED
data/hiera-mysql-backend.gemspec
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "hiera-mysql-backend"
|
5
|
-
gem.version = "0.0.
|
5
|
+
gem.version = "0.0.5"
|
6
6
|
gem.authors = ["Telmo"]
|
7
7
|
gem.email = ["telmox@gmail.com"]
|
8
8
|
gem.description = %q{Alternative MySQL backend for hiera}
|
9
9
|
gem.summary = %q{Alternative MySQL backend for hiera}
|
10
10
|
gem.homepage = "https://github.com/Telmo/hiera-mysql-backend"
|
11
|
+
gem.license = "MIT"
|
11
12
|
|
12
13
|
gem.files = `git ls-files`.split($/)
|
13
14
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -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
|
+
results = nil
|
24
24
|
|
25
25
|
Hiera.debug("looking up #{key} in MySQL2 Backend")
|
26
26
|
Hiera.debug("resolution type is #{resolution_type}")
|
@@ -37,24 +37,26 @@ class Hiera
|
|
37
37
|
mysql_host = data.fetch(:dbconfig, {}).fetch(:host, nil) || Config[:mysql2][:host]
|
38
38
|
mysql_user = data.fetch(:dbconfig, {}).fetch(:user, nil) || Config[:mysql2][:user]
|
39
39
|
mysql_pass = data.fetch(:dbconfig, {}).fetch(:pass, nil) || Config[:mysql2][:pass]
|
40
|
+
mysql_port = data.fetch(:dbconfig, {}).fetch(:port, nil) || Config[:mysql2][:port]
|
40
41
|
mysql_database = data.fetch(:dbconfig, {}).fetch(:database, nil) || Config[:mysql2][:database]
|
41
42
|
|
42
43
|
connection_hash = {
|
43
|
-
:host => mysql_host,
|
44
|
-
:username => mysql_user,
|
45
|
-
:password => mysql_pass,
|
44
|
+
:host => mysql_host,
|
45
|
+
:username => mysql_user,
|
46
|
+
:password => mysql_pass,
|
46
47
|
:database => mysql_database,
|
48
|
+
:port => mysql_port,
|
47
49
|
:reconnect => true}
|
48
50
|
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
52
|
+
Hiera.debug("data #{data.inspect}")
|
53
|
+
next if data.empty?
|
54
|
+
next unless data.include?(key)
|
53
55
|
|
54
|
-
|
56
|
+
Hiera.debug("Found #{key} in #{source}")
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
+
new_answer = Backend.parse_answer(data[key], scope)
|
59
|
+
results = query(connection_hash, new_answer)
|
58
60
|
|
59
61
|
end
|
60
62
|
return results
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-mysql-backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Telmo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|
@@ -68,7 +68,8 @@ files:
|
|
68
68
|
- hiera-mysql-backend.gemspec
|
69
69
|
- lib/hiera/backend/mysql2_backend.rb
|
70
70
|
homepage: https://github.com/Telmo/hiera-mysql-backend
|
71
|
-
licenses:
|
71
|
+
licenses:
|
72
|
+
- MIT
|
72
73
|
metadata: {}
|
73
74
|
post_install_message:
|
74
75
|
rdoc_options: []
|
@@ -86,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
87
|
version: '0'
|
87
88
|
requirements: []
|
88
89
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.2.0
|
90
|
+
rubygems_version: 2.2.0.rc.1
|
90
91
|
signing_key:
|
91
92
|
specification_version: 4
|
92
93
|
summary: Alternative MySQL backend for hiera
|