mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
(rubocop) Fix Style/ConditionalAssignment
This commit is contained in:
parent
613121f34d
commit
dec621e9b8
2 changed files with 6 additions and 10 deletions
|
|
@ -12,11 +12,11 @@ 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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -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}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue