Sha256: 81a6941832776432c8feab07ba67a73d51b2417c7ee8381667140ba5be1bc65b

Contents?: true

Size: 1.78 KB

Versions: 28

Compression:

Stored size: 1.78 KB

Contents

class Setting::RhCloud < Setting
  ::Setting::BLANK_ATTRS.concat %w{rh_cloud_token}

  def self.load_defaults
    return false unless table_exists?
    transaction do
      # If the user had auto_upload default setting, we will not surprise him, and force the value to false
      # for new users, the default will be set to true and the value will remain nil
      Setting.where(name: 'allow_auto_inventory_upload', value: nil).where("settings.default LIKE '%false%'").update_all(value: "--- false\n...")
      super
    end
  end

  def self.default_settings
    return unless ActiveRecord::Base.connection.table_exists?('settings')
    [
      set('allow_auto_inventory_upload', N_('Enable automatic upload of your host inventory to the Red Hat cloud'), true, N_('Automatic inventory upload')),
      set('allow_auto_insights_sync', N_('Enable automatic synchronization of Insights recommendations from the Red Hat cloud'), false, N_('Synchronize recommendations Automatically')),
      set('obfuscate_inventory_hostnames', N_('Obfuscate host names sent to the Red Hat cloud'), false, N_('Obfuscate host names')),
      set('obfuscate_inventory_ips', N_('Obfuscate ipv4 addresses sent to the Red Hat cloud'), false, N_('Obfuscate host ipv4 addresses')),
      set('rh_cloud_token', N_('Authentication token to Red Hat cloud services. Used to authenticate requests to cloud APIs'), nil, N_('Red Hat Cloud token'), nil, encrypted: true),
      set('exclude_installed_packages', N_('Exclude installed packages from being uploaded to the Red Hat cloud'), false, N_("Exclude installed Packages")),
      set('include_parameter_tags', N_('Should import include parameter tags from Foreman?'), false, N_('Include parameters in insights-client reports')),
    ]
  end

  def self.humanized_category
    N_('RH Cloud')
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman_rh_cloud-4.0.36 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.33 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.35 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.32 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.32 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.31 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.30 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.29 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.29 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.28 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.27 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.26 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.26 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.25.1 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.25 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.25 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.24.1 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.24.1 app/models/setting/rh_cloud.rb
foreman_rh_cloud-3.0.24 app/models/setting/rh_cloud.rb
foreman_rh_cloud-4.0.24 app/models/setting/rh_cloud.rb