crowbar/barclamp-crowbar — pull request #586 by rhafer (2013-07-09 14:57:20+00:00)
Title: Fix error handling in find_role_by_name

When find_role_by_name was called while the chef-server was restarting
(Chef::Role.load throwing a connecting refused exception) this was handled as
if the role was not present in chef. This can lead to a problem where the
Node Role of the admin node will be overwritten, when the chef-server is
restarted while a client tries to load http://:3000/nodes/status.

This patch changes find_role_by_name to only return nil if Chef::Role.load
returns "Not found". All other exception thrown by Chef::Role.load are treated
as errors.