Skip to content

Instantly share code, notes, and snippets.

@jlsherrill
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlsherrill/66842924e4248900ef77 to your computer and use it in GitHub Desktop.
Save jlsherrill/66842924e4248900ef77 to your computer and use it in GitHub Desktop.
Fixing clean_backend_objects

find the file:

/opt/rh/ruby193/root/usr/share/gems/gems/katello-2.0.0/lib/katello/tasks/clean_backend_objects.rake

###1. on line 13 change:

system.facts to

if system.uuid
  ::Katello::Resources::Candlepin::Consumer.get(system.uuid)
else 
  cp_fail = true
end

###2. also, at the top of the file, change:

        pulp_fail = false

to

        pulp_fail = true

###3. change:

 system.del_candlepin_consumer unless cp_fail

to

::Katello::Resources::Candlepin::Consumer.destroy(system.uuid) if (!cp_fail && system.uuid)

###4. below this line:

system.system_activation_keys.destroy_all

add:

system.system_host_collections.destroy_all

so it looks like:

system.system_activation_keys.destroy_all
system.system_host_collections.destroy_all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment