Skip to content

Commit

Permalink
Fixes #37194 - Uses ENV option for RHSM and UPSTREAM_RHSM
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed Jul 26, 2024
1 parent 57ca585 commit 8ab0088
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/lib/katello/resources/candlepin/upstream_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions app/models/katello/glue/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 8ab0088

Please sign in to comment.