Skip to content

Commit

Permalink
another attempt to comply with rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Kees van Veen committed Oct 7, 2024
1 parent 7c75188 commit dd03bba
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions app/models/foreman_fog_proxmox/proxmox_volumes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ def update_extra_volumes_definitions(data_in)
# Start to look into the data that needs to be updated
volumes_attributes = {}
value.each do |index, dev_specs|
nr_of_keys_found = dev_specs.keys.count

Check failure on line 36 in app/models/foreman_fog_proxmox/proxmox_volumes.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
# Only if this contains only 1 set like: {"size"=>"xxGB"}
if #{index} > 0 && nr_of_keys_found == 1
if #{index} > 0 && dev_specs.keys.count == 1

Check failure on line 38 in app/models/foreman_fog_proxmox/proxmox_volumes.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/LeadingCommentSpace: Missing space after `#`.

# Copy the data from the first entry
newid = "#{value['0']['controller']}#{index}"
newid = "#{value['0']['controller']}#{index}"

Check failure on line 41 in app/models/foreman_fog_proxmox/proxmox_volumes.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/ConditionPosition: Place the condition on the same line as `if`.

Check failure on line 41 in app/models/foreman_fog_proxmox/proxmox_volumes.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Lint/AssignmentInCondition: Use `==` if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition.
newdev = {
'storage_type' => value['0']['storage_type'],
'storage' => value['0']['storage'],
'controller' => value['0']['controller'],
'cache' => value['0']['cache'],
'device' => index,
'id' => newid,
'size' => dev_specs['size'],
'storage' => value['0']['storage'],
'controller' => value['0']['controller'],
'cache' => value['0']['cache'],
'device' => index,
'id' => newid,
'size' => dev_specs['size'],
}
volumes_attributes[index] = newdev
else
Expand Down

0 comments on commit dd03bba

Please sign in to comment.