Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.8.10
-
Fix Version/s: None
-
Component/s: Chef Client
-
Labels:None
-
Environment:
Ubuntu lucid
Rackspace Cloud
Description
Sometimes, when requesting a value for an attribute, I get back a Chef::Node::Attribute instead of the value I expect. I've caught it in a debug session. For some reason, calling #to_hash on the parent object causes the issue to flatten out.
For example:
(rdb:1) node[:lt_demo][:app_env].class Chef::Node::Attribute (rdb:1) node[:lt_demo][:app_env].keys NoMethodError Exception: undefined method `keys' for "production":String (rdb:1) node[:lt_demo].to_hash {"port"=>8082, "domain"=>"leadtune.com", "app_env"=>"production", "branch"=>"production"} (rdb:1) node[:lt_demo][:app_env].class String
The bug is causing "#<Chef::Node::Attribute:0x4548dd8>" to appear in my erb templates, instead of "production" as I would expect.
Here is a screenshot of the attributes as seen in chef-server for this node:
http://screencast.com/t/MGRmNmVhNGEt
Nothing looks abnormal.
Activity
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
|
838d 21h 17m | 1 | Daniel DeLeo | 24/Oct/12 9:57 PM |