lib/r10k/action/puppetfile/check.rb in r10k-3.11.0 vs lib/r10k/action/puppetfile/check.rb in r10k-3.12.0

- old
+ new

@@ -1,19 +1,21 @@ -require 'r10k/puppetfile' require 'r10k/action/base' require 'r10k/errors/formatting' +require 'r10k/module_loader/puppetfile' module R10K module Action module Puppetfile class Check < R10K::Action::Base def call - pf = R10K::Puppetfile.new(@root, - {moduledir: @moduledir, - puppetfile_path: @puppetfile}) + options = { basedir: @root } + options[:moduledir] = @moduledir if @moduledir + options[:puppetfile] = @puppetfile if @puppetfile + + loader = R10K::ModuleLoader::Puppetfile.new(**options) begin - pf.load! + loader.load! $stderr.puts _("Syntax OK") true rescue => e $stderr.puts R10K::Errors::Formatting.format_exception(e, @trace) false