mirror of
https://github.com/puppetlabs/vmpooler-provider-vsphere.git
synced 2026-01-26 03:18:41 -05:00
Fix getting IP by not returning a bad address
This commit is contained in:
parent
7822b2182e
commit
f02e0eb19a
3 changed files with 34 additions and 2 deletions
|
|
@ -603,9 +603,11 @@ module Vmpooler
|
|||
ip_loop_delay = 1
|
||||
ip_loop_count = 1
|
||||
ip = nil
|
||||
invalid_addresses = /(0|169)\.(0|254)\.\d+\.\d+/
|
||||
while ip.nil?
|
||||
sleep(ip_loop_delay)
|
||||
ip = vm_object.guest_ip
|
||||
ip = nil if !ip.nil? && ip.match?(invalid_addresses)
|
||||
unless ip_maxloop == 0
|
||||
break if ip_loop_count >= ip_maxloop
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue