Katello/katello — pull request #2658 by parthaa (2013-07-18 20:28:27+00:00)
Title: Added elastic search if to help with migration

During a katello-upgrade we turn off elastic search
before we run a db:migrate. This implies that all the
migration scripts should be able to run without elastic search
support. However the legacy promotion migration does things like
publish content view definitions which run calls on elastic.
So needed to add if Katello.config.use_elasticsearch lines
in the model to make sure that code is only executed when
elastic search is turned on. The upgrade script automatically
runs a reindex operation after completing the db migration in any case.