fix rubocop offences

This commit is contained in:
Samuel Beaulieu 2022-07-27 13:55:22 -05:00
parent c028000a61
commit a09deaf1f3
No known key found for this signature in database
GPG key ID: 12030F74136D0F34

View file

@ -196,11 +196,11 @@ module Vmpooler
subnet_id = get_subnet_id(pool_name) subnet_id = get_subnet_id(pool_name)
domain_set = domain domain_set = domain
if domain_set.nil? name_to_use = if domain_set.nil?
name_to_use = new_vmname new_vmname
else else
name_to_use = "#{new_vmname}.#{domain_set}" "#{new_vmname}.#{domain_set}"
end end
tag = [ tag = [
{ {
@ -216,7 +216,7 @@ module Vmpooler
}, },
{ {
key: 'lifetime', # required by AWS reaper key: 'lifetime', # required by AWS reaper
value: get_max_lifetime value: max_lifetime
}, },
{ {
key: 'created_by', # required by AWS reaper key: 'created_by', # required by AWS reaper
@ -479,7 +479,7 @@ module Vmpooler
end end
# returns max_lifetime_upper_limit in hours in the format Xh defaults to 12h # returns max_lifetime_upper_limit in hours in the format Xh defaults to 12h
def get_max_lifetime def max_lifetime
max_hours = global_config[:config]['max_lifetime_upper_limit'] || '12' max_hours = global_config[:config]['max_lifetime_upper_limit'] || '12'
"#{max_hours}h" "#{max_hours}h"
end end
@ -498,11 +498,11 @@ module Vmpooler
return nil if pool_configuration.nil? return nil if pool_configuration.nil?
domain_set = domain domain_set = domain
if domain_set.nil? name_to_use = if domain_set.nil?
name_to_use = vm_object.private_dns_name vm_object.private_dns_name
else else
name_to_use = vm_object.tags.detect { |f| f.key == 'Name' }&.value vm_object.tags.detect { |f| f.key == 'Name' }&.value
end end
{ {
'name' => name_to_use, 'name' => name_to_use,