Commit 55054714 authored by Franco Pellegrini's avatar Franco Pellegrini Committed by Godefroid Chapelle

Allow to run buildout in FIPS enabled environments

parent 02ba9731
Allow to run buildout in FIPS enabled environments.
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
from zc.buildout.rmtree import rmtree from zc.buildout.rmtree import rmtree
import zc.buildout.easy_install import zc.buildout.easy_install
from functools import partial
try: try:
from hashlib import md5 from hashlib import md5 as md5_original
except ImportError: except ImportError:
from md5 import md5 from md5 import md5 as md5_original
try: try:
from collections.abc import MutableMapping as DictMixin from collections.abc import MutableMapping as DictMixin
...@@ -52,6 +54,12 @@ if PY3: ...@@ -52,6 +54,12 @@ if PY3:
else: else:
text_type = unicode text_type = unicode
try:
hashed = md5_original(b'test')
md5 = md5_original
except ValueError:
md5 = partial(md5_original, usedforsecurity=False)
def command(method): def command(method):
method.buildout_command = True method.buildout_command = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment