Sha256: cea80719e47cee7dfd97d97f5752726efa3765b6ed021e7198f42271f69eb8a4

Contents?: true

Size: 805 Bytes

Versions: 9

Compression:

Stored size: 805 Bytes

Contents

# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# !!! PLEASE KEEP THIS SCRIPT IDEMPOTENT !!!
#

if Location.exists? &&
    !Setting[:default_location_subscribed_hosts].present? ||
    !Setting[:default_location_puppet_content].present?
  # Create a new location to be used as the Katello Default.
  default_location = Location.where(:name => ENV['SEED_LOCATION']).first_or_create
  if Setting[:default_location_subscribed_hosts].empty?
    Setting[:default_location_subscribed_hosts] = default_location.title
  end
  if Setting[:default_location_puppet_content].empty?
    Setting[:default_location_puppet_content] = default_location.title
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-3.4.5 db/seeds.d/101-locations.rb
katello-3.4.4 db/seeds.d/101-locations.rb
katello-3.4.2 db/seeds.d/101-locations.rb
katello-3.4.1 db/seeds.d/101-locations.rb
katello-3.4.0.2 db/seeds.d/101-locations.rb
katello-3.4.0.1 db/seeds.d/101-locations.rb
katello-3.4.0 db/seeds.d/101-locations.rb
katello-3.4.0.rc2 db/seeds.d/101-locations.rb
katello-3.4.0.rc1 db/seeds.d/101-locations.rb