Katello/katello — pull request #3980 by iNecas (2014-04-15 14:22:45+00:00)
Title: Fixes #4826 - rework reposets to not create repositories on repo set enable

The previous way of reposet enable was creating disabled repositories when
the reposet was enabled. These repositories were not usable till enabled
and it takes quite long to have them created, provided that most of the
disabled repositories will not be used anyway.

It also meant we needed to keep the repos in sync with the CDN, once the
reposet was enabled.

With the new approach, there is no notion of enabled/disabled repository
set. Instead, one can get the list of available repositories for the
repository set and enable/disable subset of the available repositories.
Enable available repository means creation of the repository, disable means
deletion. Therefore, no need for having special flag tracking the
enablement status on the repository itself.

The current workflow (in hammer language is:)

repository-set list --product-id $PRODUCT_ID # to get $CONTENT_ID
repository-set available-repositories --product-id $PRODUCT_ID --id $CONTENT_ID # to get $RELEASEVER and $BASEARCH
repository-set enable --product-id $PRODUCT_ID --id $CONTENT_ID --releasever $RELEASEVER --basearch $BASEARCH # to actually enable the repo
repository-set disable --product-id $PRODUCT_ID --id $CONTENT_ID --releasever $RELEASEVER --basearch $BASEARCH # to actually enable the repo

As part of this PR, there are also this fixes (in separate commits:)
Fixes #5023 - Repository::Destroy doesn't continue when failed in ActiveRecord #

Fixes #5201 - allow disabling lazy accessors in tests