{"action":"opened","issue":{"url":"https://api.github.com/repos/zanui/chef-thumbor/issues/15","labels_url":"https://api.github.com/repos/zanui/chef-thumbor/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/zanui/chef-thumbor/issues/15/comments","events_url":"https://api.github.com/repos/zanui/chef-thumbor/issues/15/events","html_url":"https://github.com/zanui/chef-thumbor/issues/15","id":113059286,"number":15,"title":"Default Attribute Not Setting Correctly","user":{"login":"jcderose","id":6912515,"avatar_url":"https://avatars.githubusercontent.com/u/6912515?v=3","gravatar_id":"","url":"https://api.github.com/users/jcderose","html_url":"https://github.com/jcderose","followers_url":"https://api.github.com/users/jcderose/followers","following_url":"https://api.github.com/users/jcderose/following{/other_user}","gists_url":"https://api.github.com/users/jcderose/gists{/gist_id}","starred_url":"https://api.github.com/users/jcderose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcderose/subscriptions","organizations_url":"https://api.github.com/users/jcderose/orgs","repos_url":"https://api.github.com/users/jcderose/repos","events_url":"https://api.github.com/users/jcderose/events{/privacy}","received_events_url":"https://api.github.com/users/jcderose/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-23T16:58:00Z","updated_at":"2015-10-23T16:58:00Z","closed_at":null,"body":"I have a wrapper recipe that sets the `default['thumbor']['key']` attribute, then calls the `thumbor::default` and `thumbor::config` recipes to install and configure Thumbor. However, the `default['thumbor']['key']` value I set is not overriding the existing default value (\"secretkey\") in the thumbor cookbook. Even when I set my attribute level to `normal['thumbor']['key']` in my wrapper recipe, the thumbor cookbook recipes still use the built-in \"secretkey\" value.\r\n\r\nHere's my wrapper recipe: (I'm pulling the value from Vault, but I've already confirmed that that transaction is not the problem.)\r\n\r\n```\r\nruby_block 'read the Thumbor API key' do\r\n  block do\r\n    $api_key = `vault read -format=json -address=http://127.0.0.1:8200 secret/thumbor  | jq -r .data.api_key`\r\n    $api_key = $api_key.strip\r\n    node.default[:thumbor][:key] = $api_key\r\n  end\r\nend\r\n\r\n# Install Thumbor\r\ninclude_recipe 'thumbor'\r\ninclude_recipe 'thumbor::config'\r\n```\r\n\r\nServerspec test:\r\n\r\n```\r\nrequire 'spec_helper'\r\nrequire 'fastimage'\r\nrequire 'ruby-thumbor'\r\n\r\nimage_urls = {\r\n  jpeg: 'placehold.it/300x120/E8117F/ffffff.jpg',\r\n  gif: 'placehold.it/300x120/E8117F/ffffff.gif',\r\n  png: 'placehold.it/300x120/E8117F/ffffff.png',\r\n  webp: 'placehold.it/300x120/E8117F/ffffff.jpg'\r\n}\r\n\r\ndescribe server(:app) do\r\n  image_urls.each do |format, url|\r\n\r\n      crypto = Thumbor::CryptoURL.new node['default']['thumbor']['key'] \r\n      encrypted_url = crypto.generate :width => 300, :height => 200, :image => \"#{ERB::Util.url_encode(url)}\"\r\n      request_url = \"http://127.0.0.1:9000#{encrypted_url}\"\r\n\r\n    headers = { headers: { 'Accept:' => \"image/#{format}\" } }\r\n\r\n    describe http(request_url, headers) do\r\n      it 'responds successfully' do\r\n        expect(response.status).to eq(200)\r\n      end\r\n      it \"responds as 'image/#{format}'\" do\r\n        expect(response.headers['content-type']).to eq(\"image/#{format}\")\r\n      end\r\n      it 'responds with the correct size' do\r\n        expect(FastImage.size(StringIO.new(response.body))).to eq([300, 200])\r\n      end\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nThese Serverspec tests fail when given the `node['default']['thumbor']['key']`, set in the wrapper cookbook, but pass when given the default \"secretkey\" value."}}