mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
remove deprecated get_md5 from stat (#55659)
* remove deprecated get_md5 from stat fixes #55309 * removed get_md5 from tests involving stat * keep get_md5 but hide it * rst it * ammended comment * ws * added ignore for hidden md5
This commit is contained in:
@@ -77,7 +77,6 @@
|
||||
- name: Check the stat results of the file
|
||||
stat:
|
||||
path: "{{ remote_file }}"
|
||||
get_md5: yes
|
||||
register: stat_results
|
||||
|
||||
- debug:
|
||||
@@ -94,12 +93,6 @@
|
||||
- "stat_results.stat.issock == false"
|
||||
- "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))"
|
||||
|
||||
- name: Verify that the legacy md5sum is correct
|
||||
assert:
|
||||
that:
|
||||
- "stat_results.stat.md5 == ('foo.txt\n'|hash('md5'))"
|
||||
when: ansible_fips|bool != True
|
||||
|
||||
- name: Overwrite the file via same means
|
||||
copy:
|
||||
src: foo.txt
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
- "'isreg' in stat_result.stat"
|
||||
- "'issock' in stat_result.stat"
|
||||
- "'isuid' in stat_result.stat"
|
||||
- "'md5' not in stat_result.stat" # Remove in 2.9
|
||||
- "'checksum' in stat_result.stat"
|
||||
- "stat_result.stat.checksum == '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'"
|
||||
- "'mode' in stat_result.stat"
|
||||
@@ -63,16 +62,6 @@
|
||||
- "'xoth' in stat_result.stat"
|
||||
- "'xusr' in stat_result.stat"
|
||||
|
||||
- name: check stat of file with get_md5
|
||||
stat: path={{output_dir}}/foo.txt get_md5=True
|
||||
register: stat_result_with_md5
|
||||
when: ansible_fips|bool != True
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "stat_result_with_md5.stat.md5 == '5eb63bbbe01eeed093cb22bb8f5acdc3'"
|
||||
when: ansible_fips|bool != True
|
||||
|
||||
- name: make a symlink
|
||||
file:
|
||||
src: "{{ output_dir }}/foo.txt"
|
||||
@@ -149,7 +138,6 @@
|
||||
- "'isreg' in stat_result.stat"
|
||||
- "'issock' in stat_result.stat"
|
||||
- "'isuid' in stat_result.stat"
|
||||
- "'md5' not in stat_result.stat"
|
||||
- "'checksum' in stat_result.stat"
|
||||
- "stat_result.stat.checksum == '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'"
|
||||
- "'mode' in stat_result.stat"
|
||||
@@ -167,16 +155,3 @@
|
||||
- "'xgrp' in stat_result.stat"
|
||||
- "'xoth' in stat_result.stat"
|
||||
- "'xusr' in stat_result.stat"
|
||||
|
||||
- name: check stat of a symlink with follow on with get_md5
|
||||
stat:
|
||||
path: "{{ output_dir }}/foo-link"
|
||||
follow: True
|
||||
get_md5: yes
|
||||
register: stat_result_with_md5
|
||||
when: ansible_fips|bool != True
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "stat_result_with_md5.stat.md5 == '5eb63bbbe01eeed093cb22bb8f5acdc3'"
|
||||
when: ansible_fips|bool != True
|
||||
|
||||
Reference in New Issue
Block a user