Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Created June 10, 2015 14:27
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 stbenjam/069e3bfd7eab015bc04d to your computer and use it in GitHub Desktop.
Save stbenjam/069e3bfd7eab015bc04d to your computer and use it in GitHub Desktop.
namespace :katello do
task :reconnect_capsule do
User.current = User.anonymous_admin
SmartProxy.all.each do |proxy|
content_host = ::Katello::System.where(:name => proxy.name).order("created_at DESC").first
if content_host
proxy.content_host_id = content_host.id
proxy.save!
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment