chef-boneyard / delivery-sugar

DEPRECATED: Library cookbook that adds sugar to build cookbooks for Chef Delivery
Apache License 2.0
12 stars 26 forks source link

Fix so with_server_config uses configured workspace path for knife rb #8

Closed christinedraper closed 8 years ago

christinedraper commented 8 years ago

Currently, with_server_config always uses /var/opt/delivery/workspace when looking for the knife.rb file, and does not pick up node['delivery']['workspace_path']. This is because DeliverySugar::ChefServer initialization is using the DSL delivery_knife_rb. Within the context of a recipe, this will correctly evaluate. However, in the context of the ChefServer class there is no node method and so change raises an exception and delivery_workspace returns the default value.

The fix avoids this by passing in delivery_knife_rb evaluated in the context of the recipe.

afiune commented 8 years ago

Great fix!! I'm pushing it through Delivery! 👍

afiune commented 8 years ago

I fixed some of the tests but overall I like this change!! It is under Review:

screen shot 2016-05-13 at 10 58 43 am

afiune commented 8 years ago

Change merged! Thank you @christinedraper https://github.com/chef-cookbooks/delivery-sugar/commit/3d13ff87762f0feb0fe7895f1433bffe298e3f42