Skip to content

CHEF-2739 - Adds script_path feature#183

Closed
kcbraunschweig wants to merge 9 commits into
chef:masterfrom
kcbraunschweig:execdir
Closed

CHEF-2739 - Adds script_path feature#183
kcbraunschweig wants to merge 9 commits into
chef:masterfrom
kcbraunschweig:execdir

Conversation

@kcbraunschweig

Copy link
Copy Markdown
Contributor

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

Comment thread chef/lib/chef/knife/exec.rb Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll return here even if the script doesn't exist... shouldn't we throw an error? Or check it above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit below addresses this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more commit to cleanup the flow. Thanks for your input.

@btm

btm commented Jun 21, 2012

Copy link
Copy Markdown
Contributor

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!

@btm btm closed this Jun 21, 2012
sersut pushed a commit that referenced this pull request Sep 30, 2015
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants