mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-26 13:28:42 -05:00
(maint) Include tags in host pretty printing when available
This commit is contained in:
parent
8111005c81
commit
1dd8230017
2 changed files with 64 additions and 1 deletions
|
|
@ -51,6 +51,7 @@ class Utils
|
|||
vms[host]['template'] = vm_info[host]['template']
|
||||
vms[host]['lifetime'] = vm_info[host]['lifetime']
|
||||
vms[host]['running'] = vm_info[host]['running']
|
||||
vms[host]['tags'] = vm_info[host]['tags']
|
||||
end
|
||||
end
|
||||
vms
|
||||
|
|
@ -64,8 +65,13 @@ class Utils
|
|||
template = info['template']
|
||||
lifetime = info['lifetime']
|
||||
running = info['running']
|
||||
tags = info['tags'] || {}
|
||||
|
||||
puts "- #{vm}.#{domain} (#{template}, #{running}/#{lifetime} hours)"
|
||||
tag_pairs = tags.map {|key,value| "#{key}: #{value}" }
|
||||
duration = "#{running}/#{lifetime} hours"
|
||||
metadata = [template, duration, *tag_pairs]
|
||||
|
||||
puts "- #{vm}.#{domain} (#{metadata.join(", ")})"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue