Enabling a repository needs to fail on pulp error
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1335898
Description of problem:
A repository can be enabled even if there is an error in pulp.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Turn off a repo in pulp
2. Try to enable this repo
1. Don't install ostree
2. Try to enable an ostree repo
you should see a pulp error in /var/log/messages but the repo will be available in the Products page.
The repo is not able to be enabled and an appropriate message is returned to the user when enabling it errors in pulp.
This is related to how we handle the task in dynflow. We should be enabling the repo in pulp first before we add it to the the database.
When enabling a repository, if there is a pulp error, the task will
be paused after creating the repository in the database, though
it is not created in pulp (since it errored). Moving this to create
in plan phase of Katello::Repository::Create ensures that the task
will stop and not complete on a pulp error, leaving the repository