Skip to content

Commit

Permalink
rubocop --auto-correct
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jan 22, 2024
1 parent ebcbeed commit 2a3a35e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end

scope '/r/insights' do
match '(/*path)(/)', :constraints => lambda { |req| !req.path.include?('view/api') }, to: 'machine_telemetries#forward_request', via: [:get, :post, :delete,:put, :patch]
match '(/*path)(/)', :constraints => ->(req) { !req.path.include?('view/api') }, :to => 'machine_telemetries#forward_request', :via => [:get, :post, :delete, :put, :patch]
end
end

Expand Down
1 change: 0 additions & 1 deletion db/seeds.d/179_ui_notifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
]

blueprints.each { |blueprint| UINotifications::Seed.new(blueprint).configure }

8 changes: 4 additions & 4 deletions db/seeds.d/50_job_templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
JobTemplate.without_auditing do
Dir[File.join("#{ForemanRhCloud::Engine.root}/app/views/job_templates/**/*.erb")].each do |template|
template = JobTemplate.import_raw!(File.read(template),
:default => true,
:lock => true,
:update => true)
:default => true,
:lock => true,
:update => true)
template.organizations = organizations if template.present?
template.locations = locations if template.present?
end
end
end
end
2 changes: 1 addition & 1 deletion foreman_rh_cloud.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Gem::Specification.new do |s|
s.test_files = Dir['test/**/*']
s.test_files -= Dir['test/**/*.orig']

s.add_dependency 'katello'
s.add_dependency 'foreman_ansible'
s.add_dependency 'foreman-tasks'
s.add_dependency 'katello'

s.add_development_dependency 'rdoc'
s.add_development_dependency 'rubocop'
Expand Down
8 changes: 4 additions & 4 deletions lib/tasks/hybrid_cloud.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace :rh_cloud do |args|
task hybridcloud_register: [:environment] do
include ::ForemanRhCloud::CertAuth
include ::InsightsCloud::CandlepinCache

def logger
@logger ||= Logger.new(STDOUT)
end
Expand All @@ -21,7 +21,7 @@ namespace :rh_cloud do |args|
logger.error('ERROR: org_id needs to be specified.')
exit(1)
end

@organization = Organization.find_by(id: ENV['org_id'].to_i) # saw this coming in as a string, so making sure it gets passed as an integer.
@uid = cp_owner_id(@organization)
@hostname = ForemanRhCloud.foreman_host_name
Expand All @@ -33,14 +33,14 @@ namespace :rh_cloud do |args|

def headers
{
Authorization: "Bearer #{@token}"
Authorization: "Bearer #{@token}",
}
end

def payload
{
"uid": @uid,
"display_name": "#{@hostname}+#{@organization.label}"
"display_name": "#{@hostname}+#{@organization.label}",
}
end

Expand Down
10 changes: 5 additions & 5 deletions lib/tasks/rh_cloud_inventory.rake
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ namespace :rh_cloud_inventory do
namespace :report do
desc 'Generate inventory report and send it to Red Hat cloud'
task generate_upload: [:environment, 'dynflow:client'] do
unless ENV['organization_id'].nil?
organizations = [ Organization.where(:id => ENV['organization_id']).first ]
else
if ENV['organization_id'].nil?
organizations = Organization.unscoped.all
else
organizations = [Organization.where(:id => ENV['organization_id']).first]
end

User.as_anonymous_admin do
Expand Down Expand Up @@ -55,8 +55,8 @@ namespace :rh_cloud_inventory do

desc "Synchronize Hosts inventory"
task sync: [:environment, 'dynflow:client'] do
if ! ENV['organization_id'].nil?
organizations = [ Organization.where(:id => ENV['organization_id']).first ]
if !ENV['organization_id'].nil?
organizations = [Organization.where(:id => ENV['organization_id']).first]
else
organizations = Organization.all
end
Expand Down

0 comments on commit 2a3a35e

Please sign in to comment.