(rubocop) Fix Style/ConditionalAssignment

This commit is contained in:
Tim Sharpe 2019-02-03 11:37:16 +11:00
parent 613121f34d
commit dec621e9b8
2 changed files with 6 additions and 10 deletions

View file

@ -12,10 +12,10 @@ class Pooler
response = conn.get 'vm'
response_body = JSON.parse(response.body)
if os_filter
hosts = response_body.select { |i| i[/#{os_filter}/] }
hosts = if os_filter
response_body.select { |i| i[/#{os_filter}/] }
else
hosts = response_body
response_body
end
hosts

View file

@ -23,11 +23,7 @@ class Ssh
response = Pooler.retrieve(verbose, os_types, token, url)
if response['ok'] == true
if host_os =~ /win/
user = 'Administrator'
else
user = 'root'
end
user = host_os =~ /win/ ? 'Administrator' : 'root'
hostname = "#{response[host_os]['hostname']}.#{response['domain']}"
cmd = "#{ssh_path} #{user}@#{hostname}"