Stop using deprecated md5, switch to hashlib. Closes #36
This commit is contained in:
parent
70bb7d47e0
commit
b8957e0c6e
@ -1,5 +1,5 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import md5
|
import hashlib
|
||||||
|
|
||||||
from moto.core import BaseBackend
|
from moto.core import BaseBackend
|
||||||
from moto.core.utils import iso_8601_datetime, rfc_1123_datetime
|
from moto.core.utils import iso_8601_datetime, rfc_1123_datetime
|
||||||
@ -22,7 +22,7 @@ class FakeKey(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def etag(self):
|
def etag(self):
|
||||||
value_md5 = md5.new()
|
value_md5 = hashlib.md5()
|
||||||
value_md5.update(self.value)
|
value_md5.update(self.value)
|
||||||
return '"{0}"'.format(value_md5.hexdigest())
|
return '"{0}"'.format(value_md5.hexdigest())
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import md5
|
import hashlib
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from moto.core import BaseBackend
|
from moto.core import BaseBackend
|
||||||
@ -15,7 +15,7 @@ class Message(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def md5(self):
|
def md5(self):
|
||||||
body_md5 = md5.new()
|
body_md5 = hashlib.md5()
|
||||||
body_md5.update(self.body)
|
body_md5.update(self.body)
|
||||||
return body_md5.hexdigest()
|
return body_md5.hexdigest()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user