diff options
author | Rob Crittenden <rcritten@redhat.com> | 2009-09-16 13:01:28 -0400 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-09-28 15:30:22 -0600 |
commit | 30f9f7772771a33f887ad1f4749352078e6c0fd4 (patch) | |
tree | 452fdb20c6f8693e65b7af16f58cb300e2d31f7e /ipalib | |
parent | 944371a38ca774d600c366726f3b734721f6fada (diff) | |
download | freeipa-30f9f7772771a33f887ad1f4749352078e6c0fd4.tar.gz freeipa-30f9f7772771a33f887ad1f4749352078e6c0fd4.tar.xz freeipa-30f9f7772771a33f887ad1f4749352078e6c0fd4.zip |
Fix Python 2.6 deprecation warning with the md5 import. Use hashlib instead.
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/ipauuid.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipalib/ipauuid.py b/ipalib/ipauuid.py index 19b8415ff..25bd70aaa 100644 --- a/ipalib/ipauuid.py +++ b/ipalib/ipauuid.py @@ -529,8 +529,11 @@ def uuid1(node=None, clock_seq=None): def uuid3(namespace, name): """Generate a UUID from the MD5 hash of a namespace UUID and a name.""" - import md5 - hash = md5.md5(namespace.bytes + name).digest() + try: + from hashlib import md5 + except ImportError: + from md5 import md5 + hash = md5(namespace.bytes + name).digest() return UUID(bytes=hash[:16], version=3) def uuid4(): |