Skip to content

Commit

Permalink
ec2_lc: deprecate device_type option (#55697)
Browse files Browse the repository at this point in the history
Fixes #55308
  • Loading branch information
mkrizek authored and s-hertel committed Apr 24, 2019
1 parent 27b64d6 commit 43712f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/55308-ec2_lc-deprecations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ec2_lc - Remove deprecated ``device_type`` option (https://github.com/ansible/ansible/issues/55308)
15 changes: 0 additions & 15 deletions lib/ansible/modules/cloud/amazon/ec2_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,21 +389,6 @@


def create_block_device_meta(module, volume):
# device_type has been used historically to represent volume_type,
# however ec2_vol uses volume_type, as does the BlockDeviceType, so
# we add handling for either/or but not both
if 'device_type' in volume:
if 'volume_type' in volume:
module.fail_json(msg='device_type is a deprecated name for volume_type. '
'Do not use both device_type and volume_type')
else:
module.deprecate('device_type is deprecated for block devices - use volume_type instead',
version=2.9)

# rewrite device_type key to volume_type
if 'device_type' in volume:
volume['volume_type'] = volume.pop('device_type')

if 'snapshot' not in volume and 'ephemeral' not in volume and 'no_device' not in volume:
if 'volume_size' not in volume:
module.fail_json(msg='Size must be specified when creating a new volume or modifying the root volume')
Expand Down

0 comments on commit 43712f8

Please sign in to comment.