SimpleFinance/chef-rabbitmq — pull request #25 by jakedavis (2014-05-20 05:50:00+00:00)
Title: Cleanup management library (take 2)

Another attempt at #24. See commit messages for more information, but basically this has just one static variable, `@@client`, which we either access or create in each resource. At some point, we'll want to verify the values in the connection are consistent with the current attribute values, but that requires a change in the rabbitmq_http_api_client gem. I can try to PR that this week.

Anyway, this feels pretty solid and better than #24. It also doesn't require tracking the admin user, although it could potentially give you a wrong value if someone set `node[:rabbitmq][:default_user]` twice in one Chef run (and had RabbitMQ topology-related resources after both). Kind of an edge case though so it should be safe for 99.9% of cases.

I prefer this to creating a new `chef` user or something. Seems ugh to coerce users of this cookbook into having an extra user ("Why is this user here?" seems like a question that would come up at some point). The default user is fine for this purpose and is usually administrative anyway. Plus, this is in place of `rabbitmqctl` which runs as root. Cookbook's gotta cook.