From 14339755ce04e046478f1f774038e182a549f40d Mon Sep 17 00:00:00 2001 From: Eric Brown Date: Tue, 17 Feb 2015 21:46:07 -0800 Subject: [PATCH] Change use of random to random.SystemRandom There's no reason to use random directly unless the code really requires a pseudo-random number generator. This is for security hardening and identified by the security static analysis project called Bandit. SecImpact Change-Id: I6b5fdd8ab17ec6ed2cb8c195bee1fb5da0e90e9f --- oslo_vmware/objects/datastore.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oslo_vmware/objects/datastore.py b/oslo_vmware/objects/datastore.py index 234bf744..3d0188f3 100644 --- a/oslo_vmware/objects/datastore.py +++ b/oslo_vmware/objects/datastore.py @@ -14,7 +14,7 @@ import logging import posixpath -import random +import random as _random import six.moves.http_client as httplib import six.moves.urllib.parse as urlparse @@ -25,6 +25,7 @@ from oslo_vmware import exceptions from oslo_vmware import vim_util LOG = logging.getLogger(__name__) +random = _random.SystemRandom() class Datastore(object):