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: I8768b6c665329163cb87dc69c9fa022bdee1b65d
Closes-Bug: #1082248
This commit is contained in:
Luong Anh Tuan 2016-12-05 11:07:13 +07:00 committed by Tuan Luong-Anh
parent c4542eaaa5
commit f1865ebdf0

View File

@ -22,10 +22,9 @@ import logging
from logging.handlers import RotatingFileHandler from logging.handlers import RotatingFileHandler
from oslo_config import cfg from oslo_config import cfg
import oslo_messaging as messaging import oslo_messaging as messaging
import six from oslo_utils import uuidutils
import socket import socket
import sys import sys
import uuid
''' '''
Expected input: Expected input:
@ -86,7 +85,7 @@ def main():
logging.debug('[vitrage] publisher: %s, event: %s, payload %s', logging.debug('[vitrage] publisher: %s, event: %s, payload %s',
publisher, event_type, payload) publisher, event_type, payload)
notifier.info(ctxt={'message_id': six.text_type(uuid.uuid4()), notifier.info(ctxt={'message_id': uuidutils.generate_uuid(),
'publisher_id': publisher, 'publisher_id': publisher,
'timestamp': datetime.utcnow()}, 'timestamp': datetime.utcnow()},
event_type=event_type, event_type=event_type,