don't try to execute a function that is not available

This commit is contained in:
Thomas S Hatch 2012-06-21 19:17:33 -06:00
parent 42fb514b44
commit 2e134d0e18

View File

@ -33,4 +33,7 @@ class Cloud(object):
Create/Verify the vms in the vm data
'''
for vm_ in self.opts['vm']:
fun = '{0}.create'.format(self.provider(vm_))
if not fun in self.clouds:
print('Public cloud provider {0} is not available'.format(self.provider(vm_)))
self.clouds['{0}.create'.format(self.provider(vm_))](vm_)