lib/bolt/applicator.rb in bolt-0.21.8 vs lib/bolt/applicator.rb in bolt-0.22.0

- old
+ new

@@ -5,15 +5,14 @@ require 'find' require 'json' require 'logging' require 'minitar' require 'open3' +require 'bolt/task' require 'bolt/util/puppet_log_level' module Bolt - Task = Struct.new(:name, :implementations, :input_method) - class Applicator def initialize(inventory, executor, modulepath, pdb_client, hiera_config, max_compiles) @inventory = inventory @executor = executor @modulepath = modulepath @@ -39,19 +38,19 @@ def custom_facts_task @custom_facts_task ||= begin path = File.join(libexec, 'custom_facts.rb') impl = { 'name' => 'custom_facts.rb', 'path' => path, 'requirements' => [], 'supports_noop' => true } - Task.new('custom_facts', [impl], 'stdin') + Task.new(name: 'custom_facts', implementations: [impl], input_method: 'stdin') end end def catalog_apply_task @catalog_apply_task ||= begin path = File.join(libexec, 'apply_catalog.rb') impl = { 'name' => 'apply_catalog.rb', 'path' => path, 'requirements' => [], 'supports_noop' => true } - Task.new('apply_catalog', [impl], 'stdin') + Task.new(name: 'apply_catalog', implementations: [impl], input_method: 'stdin') end end def compile(target, ast, plan_vars) trusted = Puppet::Context::TrustedInformation.new('local', target.host, {}) @@ -119,10 +118,12 @@ Result.new(result.target, error: { 'msg' => "Puppet is not installed on the target, please install it to enable 'apply'", 'kind' => 'bolt/apply-error' }) - elsif exit_code == 1 && error_hash['msg'] =~ /Could not find executable 'ruby.exe'/ + elsif exit_code == 1 && + (error_hash['msg'] =~ /Could not find executable 'ruby.exe'/ || + error_hash['msg'] =~ /The term 'ruby.exe' is not recognized as the name of a cmdlet/) # Windows does not have Ruby present Result.new(result.target, error: { 'msg' => "Puppet is not installed on the target in $env:ProgramFiles, please install it to enable 'apply'", 'kind' => 'bolt/apply-error'