Replace uuid.uuid4() with uuidutils.generate_uuid()
Openstack common has a wrapper for generating uuids. We should use that function to generate uuids for consistency. Change-Id: I2c31de4566fd4ca1f4c9a0df4403538b00621859
This commit is contained in:
parent
c94bdafee8
commit
0d8c0c3f9c
@ -13,8 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import uuid
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
from zaqarclient.common import decorators
|
||||
from zaqarclient.queues.v1 import core
|
||||
from zaqarclient.queues.v1 import flavor
|
||||
@ -53,7 +52,7 @@ class Client(object):
|
||||
self.api_version = version
|
||||
self.auth_opts = self.conf.get('auth_opts', {})
|
||||
self.client_uuid = self.conf.get('client_uuid',
|
||||
uuid.uuid4().hex)
|
||||
uuidutils.generate_uuid(dashed=False))
|
||||
self.session = session
|
||||
|
||||
def _get_transport(self, request):
|
||||
|
@ -13,8 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import uuid
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
from zaqarclient.common import decorators
|
||||
from zaqarclient.queues.v1 import client
|
||||
from zaqarclient.queues.v1 import iterator
|
||||
@ -48,7 +47,7 @@ class Client(client.Client):
|
||||
self.api_version = version
|
||||
self.auth_opts = self.conf.get('auth_opts', {})
|
||||
self.client_uuid = self.conf.get('client_uuid',
|
||||
uuid.uuid4().hex)
|
||||
uuidutils.generate_uuid(dashed=False))
|
||||
self.session = session
|
||||
|
||||
def queue(self, ref, **kwargs):
|
||||
|
@ -13,10 +13,10 @@
|
||||
# under the License.
|
||||
#
|
||||
import json
|
||||
import uuid
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import uuidutils
|
||||
|
||||
from zaqarclient.transport import base
|
||||
from zaqarclient.transport import request
|
||||
@ -73,7 +73,7 @@ class WebsocketTransport(base.Transport):
|
||||
Required.
|
||||
:type endpoint: string
|
||||
"""
|
||||
self._websocket_client_id = str(uuid.uuid4())
|
||||
self._websocket_client_id = uuidutils.generate_uuid()
|
||||
|
||||
LOG.debug('Instantiating messaging websocket client: %s', endpoint)
|
||||
self._ws = self._create_connection(endpoint)
|
||||
|
Loading…
x
Reference in New Issue
Block a user