summaryrefslogtreecommitdiff
path: root/lib/chef/provider/execute.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-05-25 13:40:15 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-05-25 13:40:15 -0700
commit9bb4809fb7dc7b37c5334e9e3c284e182a570438 (patch)
treed57a040d10331402154cad0553ef512c600e3bbe /lib/chef/provider/execute.rb
parent2d687d12053e2888efa0441fa72f32faf6c7c5f7 (diff)
downloadchef-9bb4809fb7dc7b37c5334e9e3c284e182a570438.tar.gz
add internal flag to shell_out and execute resource
this will wind up replacing shell_out_with_systems_locale. also fixes an issue in the sysctl provider. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/execute.rb')
-rw-r--r--lib/chef/provider/execute.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index 6872e2d67d..265932db06 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2017, Chef Software Inc.
+# Copyright:: Copyright 2008-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -27,7 +27,7 @@ class Chef
provides :execute
- def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated
+ def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated, :internal
def load_current_resource
current_resource = Chef::Resource::Execute.new(new_resource.name)
@@ -55,7 +55,7 @@ class Chef
converge_by("execute #{description}") do
begin
- shell_out_with_systems_locale!(command, opts)
+ shell_out!(command, opts)
rescue Mixlib::ShellOut::ShellCommandFailed
if sensitive?
ex = Mixlib::ShellOut::ShellCommandFailed.new("Command execution failed. STDOUT/STDERR suppressed for sensitive resource")
@@ -97,6 +97,7 @@ class Chef
opts[:group] = group if group
opts[:cwd] = cwd if cwd
opts[:umask] = umask if umask
+ opts[:internal] = internal
opts[:log_level] = :info
opts[:log_tag] = new_resource.to_s
if (logger.info? || live_stream?) && !sensitive?