mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Fix token auth for methods
Properly set the header to be X-AUTH-TOKEN for requests to the pooler.
This commit is contained in:
parent
de7a9ac433
commit
98741e5e4a
4 changed files with 23 additions and 36 deletions
|
|
@ -10,7 +10,7 @@ class Vmfloaty
|
|||
include Commander::Methods
|
||||
|
||||
def run
|
||||
program :version, '0.2.3'
|
||||
program :version, '0.2.4'
|
||||
program :description, 'A CLI helper tool for Puppet Labs vmpooler to help you stay afloat'
|
||||
|
||||
config = read_config
|
||||
|
|
@ -116,13 +116,15 @@ class Vmfloaty
|
|||
c.description = ''
|
||||
c.example 'Schedules the deletion of a host or hosts', 'floaty delete myhost1,myhost2 --url http://vmpooler.example.com'
|
||||
c.option '--verbose', 'Enables verbose output'
|
||||
c.option '--token STRING', String, 'Token for vmpooler'
|
||||
c.option '--url STRING', String, 'URL of vmpooler'
|
||||
c.action do |args, options|
|
||||
verbose = options.verbose || config['verbose']
|
||||
hosts = args[0]
|
||||
token = options.token || config['token']
|
||||
url = options.url ||= config['url']
|
||||
|
||||
Pooler.delete(verbose, url, hosts)
|
||||
Pooler.delete(verbose, url, hosts, token)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue