Katello/katello — pull request #543 by bbuckingham (2012-08-29 19:56:36+00:00)
Title: 841289 - perform cleanup on failed registration with activation key

When a client/system/consumer registers with katello, the
creation of the system in katello is handled using a single db
transaction. In supporting this, it will assign the system
to the activation key, environment, subscriptions, system groups...etc.
In addition, it will create the appropriate records in pulp,
candlepin and elasticsearch.

If an error occurs when creating the katello records (e.g.
system group max members validation error), a DB rollback will
be performed on the transaction. While this cleans up the
katello DB, it does not affect pulp, candlepin and elasticsearch.

This commit is to addresses that by introducing the after_rollback
callback on the system, candlepin consumer and pulp consumer,
performing the appropriate cleanup in each handler.