summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangguoqing <zhang.guoqing@99cloud.net>2016-12-07 04:10:58 +0000
committerzhangguoqing <zhang.guoqing@99cloud.net>2016-12-07 04:10:58 +0000
commit64b0b83174d090c0b76785d517a640f9a4b6c2bc (patch)
tree06ff550254a882ddf496d7d3555e9cf27300156b
parent6feaa13610c450c8486f969703768db5319b4846 (diff)
downloadoslo-middleware-64b0b83174d090c0b76785d517a640f9a4b6c2bc.tar.gz
Replaces uuid.uuid4 with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids. We should use that function when generating uuids for consistency. Change-Id: I50cd018b490dea341e6bcfb3034a0244194b4d99 Closes-Bug: #1082248
-rw-r--r--oslo_middleware/correlation_id.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/oslo_middleware/correlation_id.py b/oslo_middleware/correlation_id.py
index 773dcba..0892ccd 100644
--- a/oslo_middleware/correlation_id.py
+++ b/oslo_middleware/correlation_id.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-import uuid
+from oslo_utils import uuidutils
from oslo_middleware import base
@@ -23,5 +23,5 @@ class CorrelationId(base.ConfigurableMiddleware):
def process_request(self, req):
correlation_id = (req.headers.get("X_CORRELATION_ID") or
- str(uuid.uuid4()))
+ uuidutils.generate_uuid())
req.headers['X_CORRELATION_ID'] = correlation_id