Skip to content

Commit a66112f

Browse files
committed
(FIXUP) Collect hostnames in array before outputting
1 parent a065b72 commit a66112f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/vmfloaty/utils.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,22 @@ def self.generate_os_hash(os_args)
7979
end
8080

8181
def self.print_fqdn_for_host(service, hostname, host_data)
82+
hostnames = []
83+
8284
case service.type
8385
when 'ABS'
8486
host_data['allocated_resources'].each do |vm_name, _i|
85-
puts vm_name['hostname']
87+
hostnames << vm_name['hostname']
8688
end
8789
when 'Pooler'
88-
puts "#{hostname}.#{host_data['domain']}"
90+
hostnames << "#{hostname}.#{host_data['domain']}"
8991
when 'NonstandardPooler'
90-
puts host_data['fqdn']
92+
hostnames << host_data['fqdn']
9193
else
9294
raise "Invalid service type #{service.type}"
9395
end
96+
97+
puts hostnames.join("\n")
9498
end
9599

96100
def self.pretty_print_hosts(verbose, service, hostnames = [], print_to_stderr = false)

0 commit comments

Comments
 (0)