Skip to content
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

Multiple cookbook_path: broken with recent cheffish (~> 0.8) #22

Closed
irvingpop opened this issue Sep 9, 2014 · 4 comments
Closed

Multiple cookbook_path: broken with recent cheffish (~> 0.8) #22

irvingpop opened this issue Sep 9, 2014 · 4 comments

Comments

@irvingpop
Copy link

Trying out cheffish 0.8, this bit of code is breaking in ec-metal: https://github.com/opscode/ec-metal/blob/master/cookbooks/ec-harness/recipes/ec2.rb#L22-L23

with_chef_local_server :chef_repo_path => repo_path,
  :cookbook_path => [ File.join(harness_dir, 'cookbooks'),
                      File.join(repo_path, 'cookbooks'),
    File.join(repo_path, 'vendor', 'cookbooks') ],

namely that clients cannot find any cookbooks from the second cookbook_path directory.
old behavior (0.7.x):

[2014-09-09T07:54:02-07:00] INFO: Starting chef-zero on port 9010 with repository at repository at /oc/src/ec-metal-aws-ubuntu
  One version per cookbook
  clients at /oc/src/ec-metal-aws-ubuntu/chef-repo/clients
  cookbooks at /oc/src/ec-metal-aws-ubuntu/cookbooks, /oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks, /oc/src/ec-metal-aws-ubuntu/chef-repo/vendor/cookbooks
  data_bags at /oc/src/ec-metal-aws-ubuntu/chef-repo/data_bags
  environments at /oc/src/ec-metal-aws-ubuntu/chef-repo/environments
  nodes at /oc/src/ec-metal-aws-ubuntu/chef-repo/nodes
  roles at /oc/src/ec-metal-aws-ubuntu/chef-repo/roles

new behavior (0.8.x):

Compiling Cookbooks...
[2014-09-08T17:00:47-07:00] INFO: Starting chef-zero on port 9010 with repository at repository at /oc/src/ec-metal-aws-ubuntu/chef-repo
  One version per cookbook
@irvingpop
Copy link
Author

@jkeiser adding a puts for options here https://github.com/opscode/cheffish/blob/master/lib/cheffish/recipe_dsl.rb#L74-82
I can confirm that cookbook_path looks sane getting passed in:

{:chef_repo_path=>"/oc/src/ec-metal-aws-ubuntu/chef-repo", :cookbook_path=>["/oc/src/ec-metal-aws-ubuntu/cookbooks", "/oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks", "/oc/src/ec-metal-aws-ubuntu/chef-repo/vendor/cookbooks"], :port=>9010, :host=>"127.0.0.1", :log_level=>:info, "acl_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/acls", "client_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/clients", "cookbook_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks", "container_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/containers", "data_bag_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/data_bags", "environment_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/environments", "group_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/groups", "node_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/nodes"}

and if I puts chef_zero_server.options I see this:

{:host=>"127.0.0.1", :port=>9010, :log_level=>:info, :generate_real_keys=>true, :single_org=>"chef", :chef_repo_path=>"/oc/src/ec-metal-aws-ubuntu/chef-repo", :cookbook_path=>["/oc/src/ec-metal-aws-ubuntu/cookbooks", "/oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks", "/oc/src/ec-metal-aws-ubuntu/chef-repo/vendor/cookbooks"], "acl_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/acls", "client_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/clients", "cookbook_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks", "container_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/containers", "data_bag_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/data_bags", "environment_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/environments", "group_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/groups", "node_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/nodes", "role_path"=>"/oc/src/ec-metal-aws-ubuntu/chef-repo/roles", :repo_mode=>"everything", :data_store=>#<Chef::ChefFS::ChefFSDataStore:0x007fcaa2a497e0 @chef_fs=#<Chef::ChefFS::FileSystem::ChefRepositoryFileSystemRootDir:0x007fcaa2a498a8 @parent=nil, @name="", @path="/", @child_paths={"clients"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/clients"], "cookbooks"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/cookbooks"], "data_bags"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/data_bags"], "environments"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/environments"], "nodes"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/nodes"], "roles"=>["/oc/src/ec-metal-aws-ubuntu/chef-repo/roles"], "users"=>[]}, @write_pretty_json=true>, @memory_store=#<ChefZero::DataStore::MemoryStore:0x007fcaa2a497b8 @single_org="chef", @real_store=#<ChefZero::DataStore::MemoryStoreV2:0x007fcaa2a49768 @data={"organizations"=>{"chef"=>{"clients"=>{"chef-validator"=>"{ \"validator\": true }", "chef-webui"=>"{ \"admin\": true }"}, "cookbooks"=>{}, "data"=>{}, "environments"=>{"_default"=>"{ \"description\": \"The default Chef environment\" }"}, "file_store"=>{"checksums"=>{}}, "nodes"=>{}, "roles"=>{}, "sandboxes"=>{}, "users"=>{"admin"=>"{ \"admin\": \"true\" }"}}}}>>>}

where :cookbook_path looks right but :data_store => @child_paths['cookbooks'] looks wrong

@irvingpop
Copy link
Author

oh, doh! it's passing :cookbook_path (right) and "cookbook_path" (wrong) in options

@irvingpop
Copy link
Author

Looks like the removal of this line https://github.com/opscode/cheffish/blob/v0.7.1/lib/cheffish/recipe_dsl.rb#L62 and L71 are what's hosing us. Seems like the logic needs to consider strings and symbols

@jkeiser
Copy link
Contributor

jkeiser commented Sep 10, 2014

@irving see PR #25 , John got there too :)

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

No branches or pull requests

2 participants