Let me get tests working and I'll update this part of the code then so I know it works. ;)
https://github.com/Katello/katello/pull/3961