(maint) Raise error when ip address is not given to vm after clone.

This commit is contained in:
isaac-hammes 2023-08-22 13:36:33 -07:00
parent 8406247b4c
commit eee7c4082a
2 changed files with 16 additions and 2 deletions

View file

@ -470,6 +470,9 @@ module Vmpooler
ip_start = Time.now
ip = provider.get_vm_ip_address(new_vmname, pool_name)
ip_finish = format('%<time>.2f', time: Time.now - ip_start)
raise StandardError, "failed to obtain IP after #{ip_finish} seconds" if ip.nil?
$logger.log('s', "[+] [#{pool_name}] Obtained IP for '#{new_vmname}' in #{ip_finish} seconds")
@redis.with_metrics do |redis|