Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Allow relative path in autoconfigure #45

Open
budde377 opened this issue Nov 20, 2015 · 1 comment
Open

Allow relative path in autoconfigure #45

budde377 opened this issue Nov 20, 2015 · 1 comment

Comments

@budde377
Copy link

When passing a relative path to api.autoconfigure() (e.g. autoconfigure('../chef-repo')) it will wrongly change convert the relative path, of the client-key, to a absolute path.

For instance: When calling autoconfigure('../chef-repo') where chef-repo contains .chef/client.pem file and configuration file .chef/knife.rb containing the line:

client_key               "#{current_dir}/client.pem"

the path of the client key will be changed from the correct relative path: ../chef-repo/.chef/client.pem to the wrong /some/abs/path/chef-repo/chef-repo/.chef/client.pem which should be /some/abs/path/chef-repo/.chef/client.pem.

This happens because of a wrong assumption at https://github.com/coderanger/pychef/blob/master/chef/api.py#L130

Tested on version 0.2.3.

Please let me know if I should create a pull-request.

@gliptak
Copy link
Contributor

gliptak commented May 11, 2016

On a related node, is there a way to get a user friendly message when the autoconfigure() returned None (was unsuccessful)? Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants