From b0d642aed5e6846d29e877f60de2c50fa8066cc2 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Thu, 3 Sep 2015 17:00:00 +0200 Subject: [PATCH] fix provider - add templatefile definition - reformat code --- lib/puppet/provider/onetemplate/cli.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/provider/onetemplate/cli.rb b/lib/puppet/provider/onetemplate/cli.rb index 5c6c49ad..dc1f7942 100644 --- a/lib/puppet/provider/onetemplate/cli.rb +++ b/lib/puppet/provider/onetemplate/cli.rb @@ -71,6 +71,7 @@ def create end if resource[:context] end end + tempfile = builder.to_xml file.write(tempfile) file.close self.debug "Creating template using #{tempfile}" @@ -114,9 +115,8 @@ def self.instances def self.prefetch(resources) templates = instances resources.keys.each do |name| - if provider = templates.find{ |template| template.name == name } - resources[name].provider = provider - end + provider = templates.find { |template| template.name == name } + resources[name].provider = provider unless provider.nil? end end