diff --git a/changelogs/fragments/55318-zfs-deprecations.yaml b/changelogs/fragments/55318-zfs-deprecations.yaml new file mode 100644 index 0000000000..2fd8003024 --- /dev/null +++ b/changelogs/fragments/55318-zfs-deprecations.yaml @@ -0,0 +1,2 @@ +minor_changes: +- zfs - Remove deprecated key=value 'option' (https://github.com/ansible/ansible/issues/55318) diff --git a/lib/ansible/modules/storage/zfs/zfs.py b/lib/ansible/modules/storage/zfs/zfs.py index e2025f4e87..690fe53e98 100644 --- a/lib/ansible/modules/storage/zfs/zfs.py +++ b/lib/ansible/modules/storage/zfs/zfs.py @@ -34,12 +34,6 @@ options: origin: description: - Snapshot from which to create a clone. - key_value: - description: - - (**DEPRECATED**) This will be removed in Ansible-2.9. Set these values in the - - C(extra_zfs_properties) option instead. - - The C(zfs) module takes key=value pairs for zfs properties to be set. - - See the zfs(8) man page for more information. extra_zfs_properties: description: - A dictionary of zfs properties to be set. @@ -227,14 +221,9 @@ def main(): name=dict(type='str', required=True), state=dict(type='str', required=True, choices=['absent', 'present']), origin=dict(type='str', default=None), - # createparent is meaningless after 2.3, but this shouldn't - # be removed until check_invalid_arguments is. - createparent=dict(type='bool', default=None), extra_zfs_properties=dict(type='dict', default={}), ), supports_check_mode=True, - # Remove this in Ansible 2.9 - check_invalid_arguments=False, ) state = module.params.get('state') @@ -243,31 +232,6 @@ def main(): if module.params.get('origin') and '@' in name: module.fail_json(msg='cannot specify origin when operating on a snapshot') - # The following is deprecated. Remove in Ansible 2.9 - # Get all valid zfs-properties - properties = dict() - for prop, value in module.params.items(): - # All freestyle params are zfs properties - if prop not in module.argument_spec: - if isinstance(value, bool): - if value is True: - properties[prop] = 'on' - else: - properties[prop] = 'off' - else: - properties[prop] = value - - if properties: - module.deprecate('Passing zfs properties as arbitrary parameters to the zfs module is' - ' deprecated. Send them as a dictionary in the extra_zfs_properties' - ' parameter instead.', version='2.9') - # Merge, giving the module_params precedence - for prop, value in module.params['extra_zfs_properties'].items(): - properties[prop] = value - - module.params['extra_zfs_properties'] = properties - # End deprecated section - # Reverse the boolification of zfs properties for prop, value in module.params['extra_zfs_properties'].items(): if isinstance(value, bool): diff --git a/test/sanity/validate-modules/ignore.txt b/test/sanity/validate-modules/ignore.txt index b6a9b879d5..6d4c831fd2 100644 --- a/test/sanity/validate-modules/ignore.txt +++ b/test/sanity/validate-modules/ignore.txt @@ -772,8 +772,6 @@ lib/ansible/modules/storage/netapp/netapp_e_volume_copy.py E324 lib/ansible/modules/storage/netapp/netapp_e_volume_copy.py E326 lib/ansible/modules/storage/netapp/netapp_e_volume_copy.py E335 lib/ansible/modules/storage/purestorage/purefb_fs.py E324 -lib/ansible/modules/storage/zfs/zfs.py E322 -lib/ansible/modules/storage/zfs/zfs.py E323 lib/ansible/modules/storage/zfs/zfs_facts.py E323 lib/ansible/modules/storage/zfs/zpool_facts.py E323 lib/ansible/modules/system/known_hosts.py E324