summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-05-30 11:58:05 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-05-30 11:58:05 -0700
commitc80702c741232a5da0d410d4b8770137690430aa (patch)
tree68bd656095ee70fc53d436d3fc52f196f20508ef /lib/chef
parentfc98ec2b65e5a9a236f7374b831dcee6ab2100bb (diff)
downloadchef-c80702c741232a5da0d410d4b8770137690430aa.tar.gz
change "internal" to "default_env"
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/mixin/shell_out.rb10
-rw-r--r--lib/chef/provider/execute.rb4
-rw-r--r--lib/chef/resource/execute.rb4
-rw-r--r--lib/chef/resource/sysctl.rb4
4 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index cb6e02bd7e..236ef844b1 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -104,9 +104,9 @@ class Chef
# generally must support UTF-8 unicode.
def shell_out(*args, **options)
options = options.dup
- internal = options.delete(:internal)
- internal = true if internal.nil?
- if internal
+ default_env = options.delete(:default_env)
+ default_env = true if default_env.nil?
+ if default_env
env_key = options.key?(:env) ? :env : :environment
options[env_key] = {
"LC_ALL" => Chef::Config[:internal_locale],
@@ -126,11 +126,11 @@ class Chef
end
def shell_out_with_systems_locale(*args, **options) # FIXME: deprecate
- shell_out(*args, internal: false, **options)
+ shell_out(*args, default_env: false, **options)
end
def shell_out_with_systems_locale!(*args, **options) # FIXME: deprecate
- shell_out!(*args, internal: false, **options)
+ shell_out!(*args, default_env: false, **options)
end
# Helper for subclasses to convert an array of string args into a string. It
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index 265932db06..3d3255260f 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -27,7 +27,7 @@ class Chef
provides :execute
- def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated, :internal
+ def_delegators :new_resource, :command, :returns, :environment, :user, :domain, :password, :group, :cwd, :umask, :creates, :elevated, :default_env
def load_current_resource
current_resource = Chef::Resource::Execute.new(new_resource.name)
@@ -97,7 +97,7 @@ class Chef
opts[:group] = group if group
opts[:cwd] = cwd if cwd
opts[:umask] = umask if umask
- opts[:internal] = internal
+ opts[:default_env] = default_env
opts[:log_level] = :info
opts[:log_tag] = new_resource.to_s
if (logger.info? || live_stream?) && !sensitive?
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index f9165ee487..7003b546fe 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -64,8 +64,8 @@ class Chef
property :group, [ String, Integer ]
property :live_stream, [ TrueClass, FalseClass ], default: false
- # internal defaults to `false` so that the command execution more exactly matches what the user gets on the command line without magic
- property :internal, [ TrueClass, FalseClass ], desired_state: false, default: false,
+ # default_env defaults to `false` so that the command execution more exactly matches what the user gets on the command line without magic
+ property :default_env, [ TrueClass, FalseClass ], desired_state: false, default: false,
description: "When true this enables ENV magic to add path_sanity to the PATH and force the locale to English+UTF-8 for parsing output"
property :returns, [ Integer, Array ], default: 0
property :timeout, [ Integer, Float ]
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb
index 6cc525e062..496eb05cb8 100644
--- a/lib/chef/resource/sysctl.rb
+++ b/lib/chef/resource/sysctl.rb
@@ -84,7 +84,7 @@ class Chef
execute "Load sysctl values" do
command "sysctl #{'-e ' if new_resource.ignore_error}-p"
- internal true
+ default_env true
action :run
end
end
@@ -99,7 +99,7 @@ class Chef
end
execute "Load sysctl values" do
- internal true
+ default_env true
command "sysctl -p"
action :run
end