Make sure the correct profile parameters are being checked when cloning

This commit is contained in:
rallytime 2016-01-21 10:29:48 -07:00
parent 1d7e229377
commit d26ed74bde
2 changed files with 13 additions and 1 deletions

View File

@ -177,3 +177,7 @@ problems.
setting.
.. _Pull Request #733: https://github.com/saltstack/salt-bootstrap/pull/733
If the ``machine_to_clone`` does not have Salt installed on it, refrain from using
the ``script_args: -C -F`` altogether, because the new machine will need to have
Salt installed.

View File

@ -2602,9 +2602,17 @@ def is_profile_configured(opts, provider, profile_name):
provider_key = opts['providers'][alias][driver]
profile_key = opts['providers'][alias][driver]['profiles'][profile_name]
# If cloning on Linode, size and image are not necessary.
# They are obtained from the to-be-cloned VM.
linode_cloning = False
if driver == 'linode' and profile_key.get('clonefrom'):
linode_cloning = True
non_image_drivers.append('linode')
non_size_drivers.append('linode')
if driver not in non_image_drivers:
required_keys.append('image')
elif driver == 'vmware':
elif driver == 'vmware' or linode_cloning:
required_keys.append('clonefrom')
elif driver == 'nova':
nova_image_keys = ['image', 'block_device_mapping', 'block_device']