Skip to content

Commit

Permalink
Deep copy topo attrs when merging
Browse files Browse the repository at this point in the history
  • Loading branch information
christine_draper committed Nov 30, 2015
1 parent 2c88e5b commit a238d75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/chef/knife/topology_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def merge_topo_properties(nodes, topo_hash)
merged_nodes = nodes ? nodes.clone : []
merged_nodes.each do |nodeprops|

normal_defaults = topo_hash['normal'] ? topo_hash['normal'].clone : {}
normal_defaults = topo_hash['normal'] ?
Marshal.load(Marshal.dump(topo_hash['normal'])) : {}
nodeprops['normal'] ||= {}
nodeprops['normal'] = prop_merge!(normal_defaults, nodeprops['normal'])
nodeprops['normal'] = prop_merge!(nodeprops['normal'], nodeprops['attributes']) if nodeprops['attributes']
Expand Down

0 comments on commit a238d75

Please sign in to comment.