Skip to content

Commit

Permalink
Fixes #29609 - fix initializer for rails 6
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsherrill committed Apr 25, 2020
1 parent d9dc5fe commit d0dad1e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 0 additions & 5 deletions config/initializers/runcible.rb

This file was deleted.

4 changes: 4 additions & 0 deletions lib/katello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@
module Katello
require "katello/version"
require "katello/engine"

def self.pulp_server
Katello::Pulp::Server.config(SETTINGS[:katello][:pulp][:url], User.remote_user)
end
end
7 changes: 5 additions & 2 deletions lib/katello/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Engine < ::Rails::Engine
app.routes_reloader.paths << "#{Katello::Engine.root}/config/routes/mount_engine.rb"
end

initializer 'katello.load_default_settings', :before => :load_config_initializers do
initializer 'katello.load_default_settings', :before => 'katello.register_plugin' do
default_settings = {
:use_pulp => true,
:use_cp => true,
Expand Down Expand Up @@ -62,7 +62,10 @@ class Engine < ::Rails::Engine

SETTINGS[:katello] = default_settings.deep_merge(SETTINGS[:katello] || {})

require_dependency File.expand_path('../../../app/models/setting/content.rb', __FILE__) if (Setting.table_exists? rescue(false))
if (Setting.table_exists? rescue(false))
require_dependency File.expand_path('../../../app/models/setting/content.rb', __FILE__)
Setting::Content.load_defaults
end
end

initializer "katello.apipie" do
Expand Down
6 changes: 3 additions & 3 deletions lib/katello/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@

Katello::PermissionCreator.new(self).define
add_all_permissions_to_default_roles

add_permissions_to_default_roles 'System admin' => [:create_lifecycle_environments, :create_content_views]

unless Rails.env.test?
add_permissions_to_default_roles 'System admin' => [:create_lifecycle_environments, :create_content_views]
end
role 'Register hosts', [
:view_hostgroups, :view_activation_keys, :view_hosts,
:create_hosts, :edit_hosts, :destroy_hosts,
Expand Down

0 comments on commit d0dad1e

Please sign in to comment.