mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-07 08:54:01 -07: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:
parent
921cc6d650
commit
7556ac91e5
2 changed files with 22 additions and 3 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue