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:
Brian Coca
2019-05-08 10:45:45 -04:00
committed by GitHub
parent cd95843ea5
commit deae5b1bce
5 changed files with 10 additions and 53 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -354,6 +354,7 @@ lib/ansible/modules/files/lineinfile.py E323
lib/ansible/modules/files/lineinfile.py E324
lib/ansible/modules/files/lineinfile.py E326
lib/ansible/modules/files/replace.py E323
lib/ansible/modules/files/stat.py E322
lib/ansible/modules/files/stat.py E336
lib/ansible/modules/files/synchronize.py E322
lib/ansible/modules/files/synchronize.py E323