Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Last active August 29, 2015 14:22
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/06aeaf0b7a21100f272f to your computer and use it in GitHub Desktop.
Save stbenjam/06aeaf0b7a21100f272f to your computer and use it in GitHub Desktop.
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!
puts "Capsule #{proxy} has Content Host #{content_host}"
else
puts "No Content Host Found for #{proxy}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment