(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 = conn.get 'vm'
response_body = JSON.parse(response.body) response_body = JSON.parse(response.body)
if os_filter hosts = if os_filter
hosts = response_body.select { |i| i[/#{os_filter}/] } response_body.select { |i| i[/#{os_filter}/] }
else else
hosts = response_body response_body
end end
hosts hosts

View file

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