Check for token variable instead of from options

Update the get method to only retrieve tokens if one doesn't exist from
either the cli arguments or from a dotfile
This commit is contained in:
Brian Cain 2015-09-15 15:22:13 -07:00
parent d557541174
commit 7015fc3b20
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ class Vmfloaty
include Commander::Methods include Commander::Methods
def run def run
program :version, '0.2.0' program :version, '0.2.1'
program :description, 'A CLI helper tool for Puppet Labs vmpooler to help you stay afloat' program :description, 'A CLI helper tool for Puppet Labs vmpooler to help you stay afloat'
config = read_config config = read_config
@ -40,7 +40,7 @@ class Vmfloaty
return return
end end
unless options.token unless token
pass = password "Enter your password please:", '*' pass = password "Enter your password please:", '*'
token = Auth.get_token(verbose, url, user, pass) token = Auth.get_token(verbose, url, user, pass)
end end

View file

@ -1,6 +1,6 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'vmfloaty' s.name = 'vmfloaty'
s.version = '0.2.1' s.version = '0.2.2'
s.authors = ['Brian Cain'] s.authors = ['Brian Cain']
s.email = ['brian.cain@puppetlabs.com'] s.email = ['brian.cain@puppetlabs.com']
s.license = 'Apache' s.license = 'Apache'