From f5dd06ff9b57a1c83963f8c8b67d010c6f15b5ff Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Fri, 23 Jan 2015 16:36:32 +0100 Subject: [PATCH] Fix Rakefile when using PUPPETFILE env var When specifying the Puppetfile via PUPPETFILE environment variable, we are not reading the file but creating a zero-byte file. Change-Id: I48438fca726cfd91311b53e79c9145b8aa405fed --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 71731ec4..2ba1dd31 100644 --- a/Rakefile +++ b/Rakefile @@ -68,6 +68,8 @@ task :spec_prep do if !File.exists?(puppetfile_url) uri = URI.parse(puppetfile_url) puppetfile = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https').request(Net::HTTP::Get.new(uri.request_uri)).body + else + puppetfile = open(puppetfile_url).read end File.open('Puppetfile', 'w') { |file| file.write(puppetfile) } FileUtils::mkdir_p('spec/fixtures/modules')