vendored/puppet/lib/puppet/indirector/yaml.rb in bolt-0.23.0 vs vendored/puppet/lib/puppet/indirector/yaml.rb in bolt-0.24.0
- old
+ new
@@ -7,11 +7,11 @@
def find(request)
file = path(request.key)
return nil unless Puppet::FileSystem.exist?(file)
begin
- return fix(Puppet::Util::Yaml.load_file(file))
+ return load_file(file)
rescue Puppet::Util::Yaml::YamlLoadError => detail
raise Puppet::Error, _("Could not parse YAML data for %{indirection} %{request}: %{detail}") % { indirection: indirection.name, request: request.key, detail: detail }, detail.backtrace
end
end
@@ -49,15 +49,15 @@
Puppet::FileSystem.unlink(file_path) if Puppet::FileSystem.exist?(file_path)
end
def search(request)
Dir.glob(path(request.key,'')).collect do |file|
- fix(Puppet::Util::Yaml.load_file(file))
+ load_file(file)
end
end
protected
- def fix(object)
- object
+ def load_file(file)
+ Puppet::Util::Yaml.safe_load_file(file, [model, Symbol])
end
end