mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
[cloud] Allow ec2_lc module to use volume_type for block devices (#32421)
* Allow ec2_lc module to use volume_type for block devices Makes ec2_lc consistent with ec2, ec2_ami, ec2_vol etc. * Add deprecation message for device_type
This commit is contained in:
@@ -833,6 +833,9 @@ def create_block_device(module, ec2, volume):
|
||||
# we add handling for either/or but not both
|
||||
if all(key in volume for key in ['device_type', 'volume_type']):
|
||||
module.fail_json(msg='device_type is a deprecated name for volume_type. Do not use both device_type and volume_type')
|
||||
if 'device_type' in volume:
|
||||
module.deprecate('device_type is deprecated for block devices - use volume_type instead',
|
||||
version=2.9)
|
||||
|
||||
# get whichever one is set, or NoneType if neither are set
|
||||
volume_type = volume.get('device_type') or volume.get('volume_type')
|
||||
|
||||
Reference in New Issue
Block a user