From 59f241dcaa82c2dc37fcbd9fdb65157d6e4216a6 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 8 Aug 2010 23:50:02 +0200 Subject: [PATCH] [molecule.specs.plugins] image_plugin: save one function call by calling os.urandom() directly --- molecule/specs/plugins/image_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/specs/plugins/image_plugin.py b/molecule/specs/plugins/image_plugin.py index 8efdb2d..1a5f912 100644 --- a/molecule/specs/plugins/image_plugin.py +++ b/molecule/specs/plugins/image_plugin.py @@ -163,7 +163,7 @@ class ImageHandler(GenericExecutionStep, BuiltinHandlerMixin): while image_mb > 0: image_mb -= 1 if self.randomize: - arr = array.array('c', molecule.utils.get_random_str(mb_bytes)) + arr = array.array('c', os.urandom(mb_bytes)) else: arr = array.array('c', chr(0)*mb_bytes) arr.tofile(loop_f)