Reverts back variable renaming, puts in real fix for vmware image or clonefrom requirements

This commit is contained in:
Oliver Tupman 2016-08-02 11:17:19 +01:00
parent 5b9e618103
commit b198fca88d

View File

@ -2835,7 +2835,7 @@ def is_profile_configured(opts, provider, profile_name, vm_=None):
alias, driver = provider.split(':')
# Most drivers need an image to be specified, but some do not.
drivers_requiring_an_image = ['nova', 'virtualbox']
non_image_drivers = ['nova', 'virtualbox']
# Most drivers need a size, but some do not.
non_size_drivers = ['opennebula', 'parallels', 'proxmox', 'scaleway',
@ -2848,14 +2848,14 @@ def is_profile_configured(opts, provider, profile_name, vm_=None):
# If cloning on Linode, size and image are not necessary.
# They are obtained from the to-be-cloned VM.
if driver == 'linode' and profile_key.get('clonefrom', False):
drivers_requiring_an_image.append('linode')
non_image_drivers.append('linode')
non_size_drivers.append('linode')
# If cloning on VMware, specifying image is not necessary.
if driver == 'vmware' and profile_key.get('clonefrom') is None:
drivers_requiring_an_image.append('vmware')
if driver == 'vmware' and 'image' not in list(profile_key.keys()) and 'clonefrom' in list(profile_key.keys()):
non_image_drivers.append('vmware')
if driver in drivers_requiring_an_image:
if driver not in non_image_drivers:
required_keys.append('image')
if driver == 'vmware':
required_keys.append('datastore')