Skip to content

Commit

Permalink
refactor: rubocop fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanrobert committed Dec 12, 2019
1 parent a54e672 commit 789e702
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

source 'https://rubygems.org'

gemspec
gemspec
4 changes: 2 additions & 2 deletions app/models/concerns/host_ext/proxmox/interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ module Proxmox
module Interfaces
extend ActiveSupport::Concern
def update(attributes = {})
add_interfaces_to_compute_attributes(attributes) if self.provider == 'Proxmox' && attributes != nil && attributes.has_key?('compute_attributes')
add_interfaces_to_compute_attributes(attributes) if provider == 'Proxmox' && !attributes.nil? && attributes.key?('compute_attributes')
super(attributes)
end

def add_interfaces_to_compute_attributes(attributes)
attributes['compute_attributes'].store('interfaces_attributes',{})
attributes['compute_attributes'].store('interfaces_attributes', {})
attributes['interfaces_attributes'].each do |index, interface_attributes|
add_interface_to_compute_attributes(index, interface_attributes, attributes['compute_attributes']['interfaces_attributes'])
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/foreman_fog_proxmox/proxmox_vm_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def find_vm_by_uuid(uuid)
end

def find_vm_in_servers_by_uuid(servers, uuid)
servers.get(uuid) if uuid != nil && !uuid.to_s.empty?
servers.get(uuid) if !uuid.nil? && !uuid.to_s.empty?
rescue Fog::Errors::NotFound
nil
rescue StandardError => e
Expand Down

0 comments on commit 789e702

Please sign in to comment.