summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-05-23 17:56:56 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-05-23 17:56:56 -0700
commitc9e7371e4fb54daa02df949575e85dfcf812b3a2 (patch)
tree0890d598511568ed4bb9e86010bb638f02ddbb51
parentee7f7785a6b2c5439850054467c6578ecca3de00 (diff)
downloadchef-c9e7371e4fb54daa02df949575e85dfcf812b3a2.tar.gz
fix target mode checklcg/target-mode-which
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/mixin/which.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/mixin/which.rb b/lib/chef/mixin/which.rb
index 8f42a10dcf..974cb50fa3 100644
--- a/lib/chef/mixin/which.rb
+++ b/lib/chef/mixin/which.rb
@@ -40,7 +40,7 @@ class Chef
# for test stubbing
def env_path
- if Chef::Config.target_mode
+ if Chef::Config.target_mode?
Chef.run_context.transport_connection.run_command("echo $PATH").stdout
else
ENV["PATH"]
@@ -49,7 +49,7 @@ class Chef
def valid_executable?(filename, &block)
is_executable =
- if Chef::Config.target_mode
+ if Chef::Config.target_mode?
connection = Chef.run_context.transport_connection
connection.file(filename).stat[:mode] & 1 && !connection.file(filename).directory?
else