CHEF-2739 - Adds script_path feature#183
Conversation
There was a problem hiding this comment.
You'll return here even if the script doesn't exist... shouldn't we throw an error? Or check it above?
There was a problem hiding this comment.
You're right, this error isn't handled explicitly. I didn't add anything to do this, but you get the same error as you do now. It looks like this:
kc@myhost:~$ knife exec foo
ERROR: Errno::ENOENT: No such file or directory - /home/kc/foo
For an unhandled error, its pretty clear, but I can look at what some other subcommands do and add something similar.
There was a problem hiding this comment.
Commit below addresses this.
There was a problem hiding this comment.
One more commit to cleanup the flow. Thanks for your input.
Conflicts: chef/lib/chef/knife/exec.rb
|
Merged to master. KC, be careful when merging onto topic branches (rebase instead) because even when the code appears right the commit history becomes broken. The above commits are a sign that this happened. I cherry-picked your commits to avoid bringing this into the project commit history. Thanks for the patch! |
This adds a key called script_path in the chef config that takes an array of paths to look for knife exec scripts. It defaults to an empty array to mimic existing behavior. If you set a path in your knife.rb, it'll be searched in cases where the specified script isn't found in the current directory. Has debug logging and adds a bit of error handling.
Backreference to ticket:
http://tickets.opscode.com/browse/CHEF-2739