Skip to content

Commit

Permalink
Merge branch 'master' into fix-hardcoded-suma-tree-url
Browse files Browse the repository at this point in the history
  • Loading branch information
lcaparroz authored Jan 15, 2025
2 parents 5af2c79 + 29ccf26 commit 313b35a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion engines/scc_proxy/lib/scc_proxy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def scc_deactivate_product
elsif @system.hybrid? && @product.extension?
# check if product is on SCC and
# if it is -> de-activate it
scc_hybrid_system_activations = SccProxy.get_scc_activations(headers, @system)
scc_hybrid_system_activations = SccProxy.get_scc_activations(request.headers, @system)
if scc_hybrid_system_activations.map { |act| act['service']['product']['id'] == @product.id }.present?
# if product is found on SCC, regardless of the state
# it is OK to remove it from SCC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,15 @@
let(:scc_systems_activations_url) { 'https://scc.suse.com/connect/systems/activations' }

before do
stub_request(:get, scc_systems_activations_url).to_return(status: 401, body: "{\"error\": \"Error\'\"}", headers: {})
stub_request(:get, scc_systems_activations_url).to_return(status: 401, body: "{\"error\": \"Error\'\"}", headers: headers)
allow(SccProxy).to receive(:headers)
delete url, params: payload, headers: headers
end

it 'reports an error' do
data = JSON.parse(response.body)
expect(data['error']).to eq("{\"error\": \"Error'\"}")
expect(SccProxy).to have_received(:headers).with(headers['HTTP_AUTHORIZATION'], nil)
end
end

Expand Down

0 comments on commit 313b35a

Please sign in to comment.