mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
fetch idempotence test and deprecate validate_md5
Added an integration test for fetch module idempotence. (Testing that validate_checksum is doing what it's supposed to is harder as we'd have to create a race condition with the downloaded data to trigger it. Probably need to make that a unittest eventually). Also give a deprecation message to the validate_md5 parameter so that we can eventually get rid of it.
This commit is contained in:
@@ -48,11 +48,15 @@ class ActionModule(ActionBase):
|
||||
fail_on_missing = boolean(self._task.args.get('fail_on_missing'))
|
||||
validate_checksum = boolean(self._task.args.get('validate_checksum', self._task.args.get('validate_md5', True)))
|
||||
|
||||
# validate_md5 is the deprecated way to specify validate_checksum
|
||||
if 'validate_md5' in self._task.args and 'validate_checksum' in self._task.args:
|
||||
result['failed'] = True
|
||||
result['msg'] = "validate_checksum and validate_md5 cannot both be specified"
|
||||
return result
|
||||
|
||||
if 'validate_md5' in self._task.args:
|
||||
display.deprecated('Use validate_checksum instead of validate_md5', version='2.8')
|
||||
|
||||
if source is None or dest is None:
|
||||
result['failed'] = True
|
||||
result['msg'] = "src and dest are required"
|
||||
|
||||
Reference in New Issue
Block a user