mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(rubocop) Fix Layout/EmptyLineAfterGuardClause
This commit is contained in:
parent
e6d1fbf954
commit
e8f420a08c
2 changed files with 5 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ class Auth
|
||||||
|
|
||||||
res_body = JSON.parse(resp.body)
|
res_body = JSON.parse(resp.body)
|
||||||
return res_body['token'] if res_body['ok']
|
return res_body['token'] if res_body['ok']
|
||||||
|
|
||||||
raise TokenError, "HTTP #{resp.status}: There was a problem requesting a token:\n#{res_body}"
|
raise TokenError, "HTTP #{resp.status}: There was a problem requesting a token:\n#{res_body}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -24,6 +25,7 @@ class Auth
|
||||||
response = conn.delete "token/#{token}"
|
response = conn.delete "token/#{token}"
|
||||||
res_body = JSON.parse(response.body)
|
res_body = JSON.parse(response.body)
|
||||||
return res_body if res_body['ok']
|
return res_body if res_body['ok']
|
||||||
|
|
||||||
raise TokenError, "HTTP #{response.status}: There was a problem deleting a token:\n#{res_body}"
|
raise TokenError, "HTTP #{response.status}: There was a problem deleting a token:\n#{res_body}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -36,6 +38,7 @@ class Auth
|
||||||
res_body = JSON.parse(response.body)
|
res_body = JSON.parse(response.body)
|
||||||
|
|
||||||
return res_body if res_body['ok']
|
return res_body if res_body['ok']
|
||||||
|
|
||||||
raise TokenError, "HTTP #{response.status}: There was a problem getting the status of a token:\n#{res_body}"
|
raise TokenError, "HTTP #{response.status}: There was a problem getting the status of a token:\n#{res_body}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,13 @@ class Ssh
|
||||||
def self.ssh(verbose, host_os, token, url)
|
def self.ssh(verbose, host_os, token, url)
|
||||||
ssh_path = which('ssh')
|
ssh_path = which('ssh')
|
||||||
raise 'Could not determine path to ssh' unless ssh_path
|
raise 'Could not determine path to ssh' unless ssh_path
|
||||||
|
|
||||||
os_types = {}
|
os_types = {}
|
||||||
os_types[host_os] = 1
|
os_types[host_os] = 1
|
||||||
|
|
||||||
response = Pooler.retrieve(verbose, os_types, token, url)
|
response = Pooler.retrieve(verbose, os_types, token, url)
|
||||||
raise "Could not get vm from vmpooler:\n #{response}" unless response['ok']
|
raise "Could not get vm from vmpooler:\n #{response}" unless response['ok']
|
||||||
|
|
||||||
user = host_os =~ /win/ ? 'Administrator' : 'root'
|
user = host_os =~ /win/ ? 'Administrator' : 'root'
|
||||||
|
|
||||||
hostname = "#{response[host_os]['hostname']}.#{response['domain']}"
|
hostname = "#{response[host_os]['hostname']}.#{response['domain']}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue