diff --git a/zaqarclient/queues/v1/client.py b/zaqarclient/queues/v1/client.py index b81925d..22b33c2 100644 --- a/zaqarclient/queues/v1/client.py +++ b/zaqarclient/queues/v1/client.py @@ -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): diff --git a/zaqarclient/queues/v2/client.py b/zaqarclient/queues/v2/client.py index 2371c8e..e158fc7 100644 --- a/zaqarclient/queues/v2/client.py +++ b/zaqarclient/queues/v2/client.py @@ -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): diff --git a/zaqarclient/transport/ws.py b/zaqarclient/transport/ws.py index 8af6e07..0d85fdb 100644 --- a/zaqarclient/transport/ws.py +++ b/zaqarclient/transport/ws.py @@ -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)