[molecule.utils] improve random numbers generation

This commit is contained in:
Fabio Erculiani
2010-08-08 15:54:43 +02:00
parent 601b9cd752
commit 0badcb8613
+4 -1
View File
@@ -22,11 +22,14 @@ import time
import tempfile
import subprocess
import shutil
import random
random.seed()
from molecule.compat import convert_to_rawstring
RUNNING_PIDS = set()
def get_year():
"""
Return current year string.
@@ -137,7 +140,7 @@ def get_random_number():
"""
Get a random number, it uses os.urandom()
"""
return abs(hash(os.urandom(2)))%99999
return random.randint(0, 99999)
def md5sum(filepath):
"""