Merge "Replaces uuid.uuid4 with uuidutils.generate_uuid()"
This commit is contained in:
commit
95517fb5b9
@ -11,12 +11,12 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import uuid
|
|
||||||
|
|
||||||
import pecan
|
import pecan
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
from oslo_utils import uuidutils
|
||||||
# noinspection PyPackageRequirements
|
# noinspection PyPackageRequirements
|
||||||
from paste import deploy
|
from paste import deploy
|
||||||
from werkzeug import serving
|
from werkzeug import serving
|
||||||
@ -62,7 +62,7 @@ def load_app(conf):
|
|||||||
raise cfg.ConfigFilesNotFoundError([conf.api.paste_config])
|
raise cfg.ConfigFilesNotFoundError([conf.api.paste_config])
|
||||||
|
|
||||||
config = dict(conf=conf)
|
config = dict(conf=conf)
|
||||||
configkey = str(uuid.uuid4())
|
configkey = uuidutils.generate_uuid()
|
||||||
APPCONFIGS[configkey] = config
|
APPCONFIGS[configkey] = config
|
||||||
|
|
||||||
LOG.info('Full WSGI config used: %s', cfg_path)
|
LOG.info('Full WSGI config used: %s', cfg_path)
|
||||||
|
@ -25,10 +25,10 @@ from vitrage.datasources.collectd import COLLECTD_DATASOURCE
|
|||||||
from vitrage.datasources.collectd.collectd_vitrage.plugin import CollectDPlugin
|
from vitrage.datasources.collectd.collectd_vitrage.plugin import CollectDPlugin
|
||||||
from vitrage.datasources.collectd.collectd_vitrage.plugin import PluginError
|
from vitrage.datasources.collectd.collectd_vitrage.plugin import PluginError
|
||||||
|
|
||||||
import uuid
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class VitrageNotifier(CollectDPlugin):
|
|||||||
|
|
||||||
alarm_uuid = self._generate_alarm_id(notification)
|
alarm_uuid = self._generate_alarm_id(notification)
|
||||||
payload = self._create_payload(alarm_uuid, notification, severity)
|
payload = self._create_payload(alarm_uuid, notification, severity)
|
||||||
notification_id = str(uuid.uuid4())
|
notification_id = uuidutils.generate_uuid()
|
||||||
|
|
||||||
self.notifier.info(ctxt={'message_id': notification_id,
|
self.notifier.info(ctxt={'message_id': notification_id,
|
||||||
'publisher_id': COLLECTD_DATASOURCE,
|
'publisher_id': COLLECTD_DATASOURCE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user