Skip to content

Commit

Permalink
[stable-2.7] Modify the correct variable when setting available hashi…
Browse files Browse the repository at this point in the history
…ng algorithms (#52994)

* Revert "use list instead of tuple and remove md5 on ValueError (#51357)" c459f04.
* Modify the correct variable when determining available hashing algorithms.
(cherry picked from commit 23a6b88)

Co-authored-by: Sam Doran <sdoran@redhat.com>
  • Loading branch information
samdoran authored and abadger committed Mar 2, 2019
1 parent 9c7d36c commit d44f80c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/md5-hash-algorithms-pop-fix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- basic - modify the correct variable when determining available hashing algorithms to avoid errors when md5 is not available (https://github.com/ansible/ansible/issues/51355)
2 changes: 1 addition & 1 deletion lib/ansible/module_utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
try:
hashlib.md5()
except ValueError:
algorithms.pop('md5', None)
AVAILABLE_HASH_ALGORITHMS.pop('md5', None)
except Exception:
import sha
AVAILABLE_HASH_ALGORITHMS = {'sha1': sha.sha}
Expand Down

0 comments on commit d44f80c

Please sign in to comment.