mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Make sure the correct profile parameters are being checked when cloning
This commit is contained in:
parent
1d7e229377
commit
d26ed74bde
@ -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.
|
||||
|
@ -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']
|
||||
|
Loading…
Reference in New Issue
Block a user