Skip to content

Commit

Permalink
Fixes #28839 - Reset pulpcore db with reset
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Feb 4, 2020
1 parent 86015ed commit 7be3d2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hooks/boot/01-kafo-hook-extensions.rb
Expand Up @@ -37,7 +37,11 @@ def local_postgresql?
end

def local_redis?
(foreman_server? && !param_value('foreman', 'jobs_sidekiq_redis_url')) || param_value('foreman_proxy::plugin::pulp', 'pulpcore_enabled')
(foreman_server? && !param_value('foreman', 'jobs_sidekiq_redis_url')) || param_value('foreman_proxy_plugin_pulp', 'pulpcore_enabled')
end

def pulpcore_enabled?
param_value('foreman_proxy_plugin_pulp', 'pulpcore_enabled')
end

def needs_postgresql_scl_upgrade?
Expand Down
6 changes: 6 additions & 0 deletions katello/hooks/pre/10-reset_feature.rb
Expand Up @@ -8,6 +8,7 @@ def reset
reset_database
reset_candlepin
reset_pulp
reset_pulpcore

else
Kafo::KafoConfigure.logger.warn 'Katello not installed yet, can not drop database!'
Expand Down Expand Up @@ -135,6 +136,11 @@ def reset_pulp
)
end

def reset_pulcore
Kafo::KafoConfigure.logger.info 'Dropping Pulpcore database!'
execute('runuser - postgres -c "dropdb pulpcore"') if pulpcore_enabled?
end

def remote_host?(hostname)
!['localhost', '127.0.0.1', `hostname`.strip].include?(hostname)
end
Expand Down

0 comments on commit 7be3d2d

Please sign in to comment.