Created
March 17, 2012 22:08
-
-
Save RobertLowe/2065750 to your computer and use it in GitHub Desktop.
Load a Chef::Node and convert it to an actual Node object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load a chef node and turn it into an actual node object | |
node = Chef::Node.load("xxxx") # returns a hash | |
node = Chef::Node.new.tap do |n| | |
n.name( node["name"] ) | |
n.chef_environment( node["chef_environment"] ) | |
n.run_list( node["run_list"]) | |
n.normal_attrs = node["normal"] | |
n.default_attrs = node["default"] | |
n.override_attrs = node["override"] | |
n.automatic_attrs = node["automatic"] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment