Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

Explicitly set root path for default *_path options #308

Merged
merged 2 commits into from
Nov 9, 2013

Conversation

tmatilai
Copy link
Collaborator

@tmatilai tmatilai commented Nov 8, 2013

Chef 11.8.0 (with mixlib-config 2.0) sets *_path options by default based on cookbook_path. If it is an array (as always in knife-solo), the other paths are also arrays. And after #300 we'll catch that and error out.

Workaround is to explicitly specify all paths in .chef/knife.rb. Or add this:

chef_repo_path "."

While the conversion to Array is partly a regression in Chef itself (I'll file a ticket soon), we anyway want to set the default path relative to our kitchen root, as cookbook_path components might be pointing to somewhere else.

This PR also adds verification that node_path is a String. node_path made it back to Chef's default configuration in 11.8.0. And as pre 0.3.0 setups won't normally have it explicitly configured, it defaults to being an Array.

Also a user might set it to be an Array, which leads knife-solo crashing with the infamous ERROR: TypeError: no implicit conversion of Array into String. This escaped from us in #300.

Chef 11.8.0 (with mixlib-config 2.0) sets `*_path` options by default
based on `cookbook_path`. If it is an array (as always in knife-solo),
the other paths are also arrays. And matschaffer#300 will catch that and error out.

While the conversion to Array is a regression in Chef itself, we anyway
want to set the default path relative to our kitchen root, as
`cookbook_path` components might be pointing to somewhere else.
`node_path` made it back to Chef's default configuration in 11.8.0. And
as pre 0.3.0 setups won't normally have it explicitly configured, it
defaults to being an Array.

Also a user might set it to be an Array, which leads knife-solo crashing
with the infamous `ERROR: TypeError: no implicit conversion of Array
into String`. This escaped from us in matschafferGH-300.
@tmatilai
Copy link
Collaborator Author

tmatilai commented Nov 8, 2013

Chef 11.8.0 also broke our tests: https://travis-ci.org/tmatilai/knife-solo/builds/13703066
This fixes them too.

matschaffer added a commit that referenced this pull request Nov 9, 2013
Explicitly set root path for default `*_path` options
@matschaffer matschaffer merged commit 55bf4f1 into matschaffer:master Nov 9, 2013
@tmatilai tmatilai deleted the chef_11.8_paths branch November 11, 2013 01:51
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.

2 participants