mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 05:28:40 -05:00
Abstract out getting all active token vms into Utils
This commit is contained in:
parent
2c9ce5644e
commit
586f4f5c05
4 changed files with 42 additions and 33 deletions
|
|
@ -79,4 +79,17 @@ class Utils
|
|||
puts "- #{vm}.#{domain} (#{metadata.join(", ")})"
|
||||
end
|
||||
end
|
||||
|
||||
def self.get_all_token_vms(verbose, url, token)
|
||||
# get vms with token
|
||||
status = Auth.token_status(verbose, url, token)
|
||||
|
||||
vms = status[token]['vms']
|
||||
if vms.nil?
|
||||
raise "You have no running vms"
|
||||
end
|
||||
|
||||
running_vms = vms['running']
|
||||
running_vms
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue