Katello/katello — pull request #1969 by bbuckingham (2013-04-15 17:37:37+00:00)
Title: issue 1935 - fix promotion failure after view refresh

This commit addresses an error that would occur in the following
scenario:
1. create definition with a repo
2. publish the definition as view1
3. promote view1 to dev and then test environments
4. refresh view 1
5. promote view 1 to dev

At step 5, an error would occur. The reason for the error
was that as part of promoting the view, the code would
delete the candlepin environment for that view. This is not
what we want in this case because we are simply placing a
new version of the view in to that environment. The only
time that we should be deleting the candlepin environment
is if we have no other versions of the view in the environment.