Skip to content

Ensure cookbooks path exists before merging#15

Open
samumbach wants to merge 1 commit intowebsterclay:masterfrom
samumbach:ensure_cookbooks_path_exists_before_merging
Open

Ensure cookbooks path exists before merging#15
samumbach wants to merge 1 commit intowebsterclay:masterfrom
samumbach:ensure_cookbooks_path_exists_before_merging

Conversation

@samumbach
Copy link
Copy Markdown

Under the following circumstances, the cookbooks path will not exist after the
call to reset_to_default_state. In this instance, the directory should be
created before attempting to merge the new cookbook.

  • cookbooks path is an empty subdirectory within an existing git repo (e.g, my_project/cookbooks)
  • user attempts to install a cookbook cd my_project; knife cookbook github install --cookbook-path cookbooks cookbooks/yum
  • knife clones the cookbook from github and commits it to a vendor branch
  • upon switching back to the master branch, the (previously empty) cookbooks directory will no longer exist

In this instance, it should be safe to create the previously extant directory so the merge can be completed.

Under the following circumstances, the cookbooks path will not exist after the
call to reset_to_default_state. In this instance, the directory should be
created before attempting to merge the new cookbook.

- cookbooks path is an empty subdirectory within an existing git repo (e.g, my_project/cookbooks)
- user attempts to install a cookbook `cd my_project; knife cookbook github install --cookbook-path cookbooks cookbooks/yum`
- knife clones the cookbook from github and commits it to a vendor branch
- upon switching back to the master branch, the (previously empty) cookbooks directory will no longer exist

In this instance, it should be safe to create the previously extant directory so the merge can be completed.
@samumbach
Copy link
Copy Markdown
Author

I've observed this same behavior with knife cookbook site install, so I reported this as a Chef bug as well: http://tickets.opscode.com/browse/CHEF-2695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant