Skip to content

Commit

Permalink
Update module-data to f62e245b08fd4003f13be13d75ea4a899fe8d3ea
Browse files Browse the repository at this point in the history
f62e245b08fd4003f13be13d75ea4a899fe8d3ea Merge pull request redhat-openstack#24 from tamarintech/fix/config_not_deserialized
550dfa6891dfd94cdda32058561e988a4ffaaf68 safe_yaml is used by default which causes symbols from hiera.yaml to be stringified.  config[:hierarchy] incorrectly becomes config[":hierarchy"]
a3084e401f9f95bedb04b4048fe5aa63dbcd9d22 Merge pull request #1 from ripienaar/master
b2a2bec34005004bfecb6d258d8e3c4c82abc860 Merge pull request redhat-openstack#23 from tamarintech/bugfix/fallback_without_environment
90a488734f28a24507dc815f0cb9d832c9795635 Refactor to remove extra carriage return
f909b48d912a7c114400230347b375866c51e977 Allow fallback to Puppet::Module.find when find with environment fails.  Enables easier development (ex: when modulepath is specified on the command line).

Change-Id: I6f0db7cc62568c6523f11f2f8e08a2e77675cae1
  • Loading branch information
xbezdick committed Jun 23, 2015
1 parent 4529a4d commit 1777c91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mod 'module-collectd',
:git => 'https://github.com/pdxcat/puppet-module-collectd.git'

mod 'module-data',
:commit => '0eead7f411f404b0a9a73bb161aac46c9fbe3219',
:commit => 'f62e245b08fd4003f13be13d75ea4a899fe8d3ea',
:git => 'https://github.com/ripienaar/puppet-module-data.git'

mod 'mongodb',
Expand Down
10 changes: 7 additions & 3 deletions module-data/lib/hiera/backend/module_data_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(cache=nil)
def load_module_config(module_name, environment)
default_config = {:hierarchy => ["common"]}

mod = Puppet::Module.find(module_name, environment)
mod = Puppet::Module.find(module_name) unless Puppet::Module.find(module_name, environment)

return default_config unless mod

Expand All @@ -25,7 +25,7 @@ def load_module_config(module_name, environment)
Hiera.debug("Reading config from %s file" % module_config)
config = load_data(module_config)
end

config["path"] = path

default_config.merge(config)
Expand All @@ -35,7 +35,11 @@ def load_data(path)
return {} unless File.exist?(path)

@cache.read(path, Hash, {}) do |data|
YAML.load(data)
if path.end_with? "/hiera.yaml"
YAML.load(data, deserialize_symbols: true)
else
YAML.load(data)
end
end
end

Expand Down

0 comments on commit 1777c91

Please sign in to comment.