From 853649450e74da37f98c0c1e8717cb25db3fab9b Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 31 Oct 2011 11:48:50 -0400 Subject: use hashlib rather than md5 module to avoid deprecation warning. Thanks: Garrett Holmstrom LP: #883367 --- ChangeLog | 1 + cloudinit/UserDataHandler.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca4b31fc..2909069d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - add sample systemd config files [Garrett Holmstrom] - add Fedora support [Garrent Holstrom] (LP: #883286) - fix bug in netinfo.debug_info if no net devices available (LP: #883367) + - use python module hashlib rather than md5 to avoid deprecation warnings. 0.6.2: - fix bug where update was not done unless update was explicitly set. It would not be run if 'upgrade' or packages were set to be installed diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py index afd5dd99..982e57f0 100644 --- a/cloudinit/UserDataHandler.py +++ b/cloudinit/UserDataHandler.py @@ -24,7 +24,7 @@ from email import encoders import yaml import cloudinit import cloudinit.util as util -import md5 +import hashlib starts_with_mappings={ '#include' : 'text/x-include-url', @@ -66,7 +66,7 @@ def do_include(str,parts): if line.startswith("#"): continue # urls cannot not have leading or trailing white space - msum = md5.new() + msum = hashlib.md5() msum.update(line.strip()) includeonce_filename = "%s/urlcache/%s" % ( cloudinit.get_ipath_cur("data"), msum.hexdigest()) -- cgit v1.2.3