From 8ab0088491af471d8a161e26176c5f1a79dca68c Mon Sep 17 00:00:00 2001 From: Partha Aji Date: Wed, 21 Feb 2024 14:06:47 -0500 Subject: [PATCH] Fixes #37194 - Uses ENV option for RHSM and UPSTREAM_RHSM --- app/lib/katello/resources/candlepin/upstream_job.rb | 2 +- app/models/katello/glue/provider.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/lib/katello/resources/candlepin/upstream_job.rb b/app/lib/katello/resources/candlepin/upstream_job.rb index f6b78cccebd..7e009155f16 100644 --- a/app/lib/katello/resources/candlepin/upstream_job.rb +++ b/app/lib/katello/resources/candlepin/upstream_job.rb @@ -11,7 +11,7 @@ def not_finished?(job) end def get(id, upstream) - url = API_URL + url = ENV['REDHAT_RHSM_API_URL'] || API_URL response = Resources::Candlepin::UpstreamConsumer.start_upstream_export("#{url}#{path(id)}", upstream['idCert']['cert'], upstream['idCert']['key'], nil) job = JSON.parse(response) diff --git a/app/models/katello/glue/provider.rb b/app/models/katello/glue/provider.rb index 20bb6be7ee3..7bef69d4afa 100644 --- a/app/models/katello/glue/provider.rb +++ b/app/models/katello/glue/provider.rb @@ -34,7 +34,7 @@ module InstanceMethods API_URL = 'https://subscription.rhsm.redhat.com/subscription/consumers/'.freeze def api_url(upstream = {}) # Default to Red Hat - upstream['apiUrl'] || API_URL + ENV['REDHAT_RHSM_API_URL'] || upstream['apiUrl'] || API_URL end def sync @@ -65,7 +65,6 @@ def owner_upstream_update(upstream, _options) Rails.logger.error "Upstream identity certificate not available" fail _("Upstream identity certificate not available") end - params = {} params[:capabilities] = Resources::Candlepin::CandlepinPing.ping['managerCapabilities'].inject([]) do |result, element| result << {'name' => element}