Skip to content

Commit

Permalink
Fix rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv committed Jan 17, 2025
1 parent e8f7471 commit 281fed7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 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 @@ -264,7 +264,7 @@ def scc_check_subscription_expiration(headers, system, product_class = nil)
status_products_classes = if system.byos?
scc_systems_activations.map do |act|
product = act['service']['product']
if product['product_class'] == product_class && (product['free'] || (!act['status'].nil? && act['status'].casecmp('active').zero?))
if product['product_class'] == product_class && (product['free'] || (!act['status'].nil? && act['status'].casecmp('active').zero?)) # rubocop:disable Layout/LineLength
# free module or (paid extension or base product))
true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def check

protected

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def path_allowed?(headers)
path = headers['X-Original-URI']
return false if path.blank?
Expand Down Expand Up @@ -79,6 +81,8 @@ def path_allowed?(headers)
false
end
end
# rubocop:enable Metrics/CyclomaticComplexity
# rubocop:enable Metrics/PerceivedComplexity

# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
Expand Down
2 changes: 1 addition & 1 deletion engines/zypper_auth/lib/zypper_auth/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def auth_logger
Thread.current[:logger]
end

def verify_instance(request, logger, system, params_product_id = nil)
def verify_instance(request, logger, system)
return false unless request.headers['X-Instance-Data']

base_product = system.products.find_by(product_type: 'base')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
systems_count: 1,
service: {
product: {
id: system_byos.products.find_by(product_type: 'base').id, # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id,
product_class: system_byos.products.find_by(product_type: 'base').product_class # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class
id: system_byos.products.find_by(product_type: 'base').id, # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id, # rubocop:disable Layout/LineLength
product_class: system_byos.products.find_by(product_type: 'base').product_class # activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class # rubocop:disable Layout/LineLength
}
}
}
Expand Down Expand Up @@ -432,7 +432,8 @@
service: {
product: {
id: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id,
product_class: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class
product_class: system_hybrid.activations.joins(:product).where(products: { free: false,
product_type: :extension }).first.product.product_class
}
}
}
Expand Down Expand Up @@ -482,7 +483,8 @@
service: {
product: {
id: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.id,
product_class: system_hybrid.activations.joins(:product).where(products: { free: false, product_type: :extension }).first.product.product_class
product_class: system_hybrid.activations.joins(:product).where(products: { free: false,
product_type: :extension }).first.product.product_class
}
}
}
Expand Down

0 comments on commit 281fed7

Please sign in to comment.