Bug 1337515
Summary: | unable to sync puppet module to capsule: ActionController::RoutingError (No route matches [GET] "/pulp/puppet/Default_Organization-Library-test2/PULP_MANIFEST") | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Jan Hutař <jhutar> |
Component: | Foreman Proxy | Assignee: | John Mitsch <jomitsch> |
Status: | CLOSED DUPLICATE | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.2.0 | CC: | bbuckingham, cwelton, mmccune, psuriset |
Target Milestone: | Unspecified | Keywords: | Regression, Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-05-25 17:46:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jan Hutař
2016-05-19 11:29:37 UTC
Note: I have manually applied patch from bug 1337306 comment #1 on the system before I have observed this. # diff -u /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/lib/actions/middleware/backend_services_check.rb{.ORIG,} --- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/lib/actions/middleware/backend_services_check.rb.ORIG 2016-05-19 05:19:02.113026376 -0400 +++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/lib/actions/middleware/backend_services_check.rb 2016-05-19 05:20:02.139022921 -0400 @@ -9,7 +9,7 @@ to_check = services - parent.input[:services_checked] if to_check.any? - result = User.as_anonymous_admin { ::Katello::Ping.ping(to_check)[:services] } + result = User.as_anonymous_admin { ::Katello::Ping.ping(services: to_check, capsule_id: capsule_id(args))[:services] } to_check.each do |service| if result[service][:status] != ::Katello::Ping::OK_RETURN_CODE @@ -24,6 +24,11 @@ protected + def capsule_id(args) + capsule_hash = args.select { |x| x[:capsule_id] if x.is_a? Hash } + capsule_hash[0] ? capsule_hash[0][:capsule_id] : nil + end + def source_action parent = self.action until parent.trigger.nil? # diff -u /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/models/katello/ping.rb{.ORIG,} --- /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/models/katello/ping.rb.ORIG 2016-05-19 05:20:29.488021347 -0400 +++ /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.31/app/models/katello/ping.rb 2016-05-19 05:22:00.997016080 -0400 @@ -16,14 +16,14 @@ # # TODO: break up this method # rubocop:disable MethodLength - def ping(services = SERVICES) + def ping(services: SERVICES, capsule_id: nil) result = { :status => OK_RETURN_CODE, :services => {}} services.each { |service| result[:services][service] = {} } # pulp - ping without oauth if services.include?(:pulp) exception_watch(result[:services][:pulp]) do - Ping.pulp_without_oauth + Ping.pulp_without_auth(pulp_url(capsule_id)) end end @@ -98,12 +98,22 @@ packages.split("\n").sort end + def pulp_url(capsule_id) + if capsule_id + capsule_content = ::Katello::CapsuleContent.new(SmartProxy.find(capsule_id)) + uri = URI.parse(capsule_content.pulp_url) + "#{uri.scheme}://#{uri.host.downcase}/pulp/api/v2" + else + SETTINGS[:katello][:pulp][:url] + end + end + # this checks Pulp is running and responding without need # for authentication. We don't use RestClient.options here # because it returns empty string, which is not enough to say # pulp is the one that responded - def pulp_without_oauth - body = RestClient.get("#{SETTINGS[:katello][:pulp][:url]}/status/") + def pulp_without_auth(url) + body = RestClient.get("#{url}/status/") fail _("Pulp does not appear to be running.") if body.empty? json = JSON.parse(body) *** This bug has been marked as a duplicate of bug 1338009 *** |