What is this supposed to do? Isn't it at least missing an '=' between node_list and search?
Or is it just my limited ruby knowledge?

Additionally, doing the same chef search in two consecutive code lines (see line 26) also seems wrong to me.