module ForemanOpenscap::DataStreamContent

def create_or_update_profile(profile_id, title)

def create_or_update_profile(profile_id, title)
  profile = ScapContentProfile.find_by(:profile_id => profile_id, "#{self.class.to_s.demodulize.underscore}_id".to_sym => id)
  return ScapContentProfile.create(:profile_id => profile_id, :title => title, "#{self.class.to_s.demodulize.underscore}_id".to_sym => id) unless profile
  profile.update(:title => title) unless profile.title == title
  profile
end

def create_profiles

def create_profiles
  fetch_profiles.each do |key, title|
    create_or_update_profile key, title
  end
end

def proxy_url

def proxy_url
  @proxy_url ||= SmartProxy.with_features('Openscap').find(&:ping)&.url
end