fix vultr cloud race condition to match on 0*

This commit is contained in:
Ch3LL 2017-04-05 14:05:49 -06:00
parent cfba4cb422
commit aae3d14ea4
No known key found for this signature in database
GPG key ID: E913CB5901E0C81C

View file

@ -296,7 +296,8 @@ def create(vm_):
'''
data = show_instance(vm_['name'], call='action')
pprint.pprint(data)
if str(data.get('main_ip', '0')) == '0':
main_ip = str(data.get('main_ip', '0'))
if main_ip.startswith('0'):
time.sleep(3)
return False
return data['main_ip']