Merge pull request #40548 from Ch3LL/fix_vultrpy

Fix vultrpy
This commit is contained in:
Nicole Thomas 2017-04-06 09:13:51 -06:00 committed by GitHub
commit 00f8ef0c55
2 changed files with 5 additions and 2 deletions

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']

View file

@ -158,10 +158,12 @@ class VultrTest(integration.ShellCase):
'''
# check if instance with salt installed returned
try:
create_vm = self.run_cloud('-p vultr-test {0}'.format(INSTANCE_NAME), timeout=500)
self.assertIn(
INSTANCE_NAME,
[i.strip() for i in self.run_cloud('-p vultr-test {0}'.format(INSTANCE_NAME), timeout=500)]
[i.strip() for i in create_vm]
)
self.assertNotIn('Failed to start', str(create_vm))
except AssertionError:
self.run_cloud('-d {0} --assume-yes'.format(INSTANCE_NAME), timeout=500)
raise