Skip to content

Commit a4e8cec

Browse files
author
Surya Bala
committed
Fix the script error message to include absolute path
1 parent af43d01 commit a4e8cec

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/instance_agent/plugins/codedeploy/hook_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def execute
9797
log_script("LifecycleEvent - " + @lifecycle_event + "\n", script_log_file)
9898
hooks.each do |script|
9999
if(!File.exist?(script_absolute_path(script)))
100-
raise ScriptError.new(ScriptError::SCRIPT_MISSING_CODE, script.location, @script_log), 'Script does not exist at specified location: ' + script.location
100+
raise ScriptError.new(ScriptError::SCRIPT_MISSING_CODE, script.location, @script_log), 'Script does not exist at specified location: ' + File.expand_path(script_absolute_path(script))
101101
elsif(!InstanceAgent::Platform.util.script_executable?(script_absolute_path(script)))
102102
log :warn, 'Script at specified location: ' + script.location + ' is not executable. Trying to make it executable.'
103103
begin

test/instance_agent/plugins/codedeploy/hook_executor_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def create_full_hook_executor
131131
end
132132

133133
should "raise and exception" do
134-
assert_raised_with_message('Script does not exist at specified location: test', ScriptError)do
134+
assert_raised_with_message("Script does not exist at specified location: #{File.expand_path(@deployment_root_dir)}/deployment-archive/test", ScriptError)do
135135
@hook_executor.execute
136136
end
137137
end

0 commit comments

Comments
 (0)