chef-cookbooks / supermarket-omnibus-cookbook

A cookbook for installing supermarket from Omnibus (deb, rpm) packages
Apache License 2.0
17 stars 29 forks source link

Custom repository "option" non-functional due to malformed attribute #38

Closed hgregorian closed 8 years ago

hgregorian commented 8 years ago

While well-intentioned, the "passthrough" attribute for a custom repository is non-functional due to attribute misnaming:

https://github.com/chef-cookbooks/supermarket-omnibus-cookbook/blob/7fdad3a40a8d93bbddcbd884d9d88aca6b822d79/libraries/supermarket_server.rb#L81

Should be:

node.set['chef-ingredient']['custom-repo-recipe'] = node['supermarket_omnibus']['custom_repo_recipe']

_(--hyphens-- not underscores)

robbkidd commented 8 years ago

@yzl Can you take a quick look at this? I suspect tests are passing because the fixture has hyphens. https://github.com/chef-cookbooks/supermarket-omnibus-cookbook/blob/c526672b51e80611b3ede1266ed4e66b7e256475/test/fixtures/cookbooks/test/recipes/custom_repo_setup.rb#L2

hgregorian commented 8 years ago

In the 'chef-ingredient' namespace, the attribute is named custom-repo-recipe.

This cookbook (supermarket-omnibus-cookbook) refers to the similarly named (but different) "passthrough" attribute as custom_repo_recipe. The test cookbook referenced above references the attribute with hyphens instead of underscores.

ChefSpec passes because the attribute is set in the test thereby masking the naming error in the test cookbook recipe.

yzl commented 8 years ago

@robbkidd I will fix. And I hate hyphens and underscores.