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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bed2f5ccd27f43d661e3b382d5b5b3add9c7f01f
4
- data.tar.gz: de44292bef0ed41a782bc65bc25c222c5085ee05
3
+ metadata.gz: 457778db31cd7a5a4f02ffa77800a84db23db015
4
+ data.tar.gz: c816cf244a6dbe69476701fc0d4bc535a171f04b
5
5
  SHA512:
6
- metadata.gz: ad9ca9fb6314f8a4aab540b7afb9609f9b3bc1c1ee6830d9b11be896b0f069c621586e61962c751344c1e8ef14f107f0852c3b9881d29045c2d98cfb1de7775f
7
- data.tar.gz: a80ffa09404dc92db4b245700f4625b812fcec43c81795d2f309381448cac46f279af70aa861670efba062564b224985d940b980fcb16b19247ab78e9d129951
6
+ metadata.gz: 20ba1b125177932546f88f9dab29a04c042194f2ea98e2ba092fb30824649ad25b60de4ce1a1f3740ebfb5e217f933a2cfed3ae78daadb4700f21a4020cb3aaf
7
+ data.tar.gz: 82baa75051114666b65f57c025c9747d80903b1b11fb087251e50dd88cbd2621a90a3472b72b789a91ce5d8847c18c36c66ab6baca4ef3a5e148dd014d1f0e09
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/hiera-mysql-backend.png)](http://badge.fury.io/rb/hiera-mysql-backend)
2
+
1
3
  ## hiera-mysql-backend
2
4
 
3
5
  Alternate MySQL backend for Hiera
@@ -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.4"
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
- results = nil
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
- Hiera.debug("data #{data.inspect}")
51
- next if data.empty?
52
- next unless data.include?(key)
52
+ Hiera.debug("data #{data.inspect}")
53
+ next if data.empty?
54
+ next unless data.include?(key)
53
55
 
54
- Hiera.debug("Found #{key} in #{source}")
56
+ Hiera.debug("Found #{key} in #{source}")
55
57
 
56
- new_answer = Backend.parse_answer(data[key], scope)
57
- results = query(connection_hash, new_answer)
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
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-02-04 00:00:00.000000000 Z
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