Skip to content
  • Guido Trotter's avatar
    Move hash functions to the compat module · 716a32cb
    Guido Trotter authored
    
    
    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: default avatarGuido Trotter <ultrotter@google.com>
    Reviewed-by: default avatarIustin Pop <iustin@google.com>
    716a32cb