-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cookbook generator converge fails when run from the same parent directory as new cookbook #61
Comments
@bipinbachhao-lilly I just wanted to let you know that I did find a workaround for this. If you move your generator cookbook For instance, if you were to have your cookbook generator in the below path:
And then ran the following command to create a cookbook in you cookbooks directory:
The generate should work just fine. For some reason we're still looking into, having the directory for your generator cookbook in the same parent directory where you're hoping to generate your new cookbook, the generate command throws this error. If you've moved the generator cookbook to a different parent directory, or try to create your cookbooks somewhere else, then this will resolve the issue. I hope this helps. |
I also hit the same bug at a customer place. The workaround Davin posted worked. |
Having a cookbook generator in the same location as your repository ( We're considering approaches to change this behavior, but for the time being Reference chef/chef-zero#285, which documents the underlying issue. |
One alternative here would be to have Perhaps the best short term option would be to detect the condition that would lead to error (generator CB shares a parent dir with the to-be-created cookbook), and give instructions on what to do instead of going ahead with the converge |
This would be awesome. I think if we can detect this condition and have a sane error message, then it's not a bug and it's just functionality and we can close all this. :) |
Version:
Chef Workstation version: 0.16.33
Chef Infra Client version: 15.8.23
Chef InSpec version: 4.18.51
Chef CLI version: 2.0.0
Test Kitchen version: 2.3.4
Cookstyle version: 5.22.6
Environment:
[Details about the environment such as the Operating System, cookbook details, etc...]
MacOS -10.14.6
Scenario:
Generator code generator and trying use it to generate new cookbook
Steps to Reproduce:
chef generate generator test_code_generator
Try to create new cookbook using generator
chef generate cookbook -g /Users/Workspace/projects/chef/cookbooks/test_code_generator/ test_cookbook
Expected Result:
New cookbook should be generatored
Actual Result:
Generator generator:
chef generate generator test_code_generator
Copied built-in generator cookbook to /Users/Workspace/projects/chef/cookbooks/test_code_generator
Add the following to your config file to enable it:
chefcli.generator_cookbook "/Users/Workspace/projects/chef/cookbooks/test_code_generator"
Generator cookbook:
The text was updated successfully, but these errors were encountered: