Add correct headers for token requests

This commit is contained in:
Brian Cain 2015-09-15 13:38:52 -07:00
parent 3e7b2b54fe
commit 16dd780cb9

View file

@ -36,6 +36,7 @@ class Pooler
def self.modify(verbose, url, hostname, token, lifetime, tags)
modify_body = {'lifetime'=>lifetime, 'tags'=>tags}
conn = Http.get_conn_with_token(verbose, url, token)
conn.headers['X-AUTH-TOKEN']
response = conn.put do |req|
req.url "/vm/#{hostname}"
@ -84,6 +85,7 @@ class Pooler
def self.snapshot(verbose, url, hostname, token)
conn = Http.get_conn_with_token(verbose, url, token)
conn.headers['X-AUTH-TOKEN']
response = conn.post "/vm/#{hostname}/snapshot"
res_body = JSON.parse(response.body)
@ -92,6 +94,7 @@ class Pooler
def self.revert(verbose, url, hostname, token, snapshot_sha)
conn = Http.get_conn_with_token(verbose, url, token)
conn.headers['X-AUTH-TOKEN']
response = conn.post "/vm/#{hostname}/snapshot/#{snapshot}"
res_body = JSON.parse(response.body)