mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Update http method name that takes user/password
This commit is contained in:
parent
eee7aab760
commit
992a37cabf
3 changed files with 4 additions and 5 deletions
|
|
@ -4,7 +4,7 @@ require 'vmfloaty/http'
|
|||
|
||||
class Auth
|
||||
def self.get_token(verbose, url, user, password)
|
||||
conn = Http.get_conn(verbose, url, user, password)
|
||||
conn = Http.get_conn_with_auth(verbose, url, user, password)
|
||||
|
||||
resp = conn.post do |req|
|
||||
req.url '/token'
|
||||
|
|
@ -27,7 +27,7 @@ class Auth
|
|||
exit 1
|
||||
end
|
||||
|
||||
conn = Http.get_conn(verbose, url, user, password)
|
||||
conn = Http.get_conn_with_auth(verbose, url, user, password)
|
||||
|
||||
response = conn.delete "/token/#{token}"
|
||||
res_body = JSON.parse(response)
|
||||
|
|
@ -46,7 +46,7 @@ class Auth
|
|||
exit 1
|
||||
end
|
||||
|
||||
conn = Http.get_conn(verbose, url, user, password)
|
||||
conn = Http.get_conn_with_auth(verbose, url, user, password)
|
||||
|
||||
response = conn.get "/token/#{token}"
|
||||
res_body = JSON.parse(response.body)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class Http
|
|||
return conn
|
||||
end
|
||||
|
||||
def self.get_conn(verbose, url, user, password)
|
||||
def self.get_conn_with_auth(verbose, url, user, password)
|
||||
if url.nil?
|
||||
STDERR.puts "The url you provided was empty"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue