Move hash functions to the compat module
Since the hash functions' changed their module name between python 2.4 and 2.6, and we have to do an try/import/except trick, we'll do it just once, for both hash functions, and in compat.py. This also fixes a use of md5 in the utils unittests which didn't use the trick before, and generated a deprecation warning under 2.6. In compat we keep both a ganeti-wide non-version-specific version to be used by other ganeti modules, and a python-version specific that can be passed to python modules which expect a hash function for their input but call it differently under different versions of python (hmac, for example). Signed-off-by:Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
Loading
Please register or sign in to comment