Merge "Replace uuid.uuid4() with uuidutils.generate_uuid()"
This commit is contained in:
commit
bb17197016
|
@ -15,10 +15,10 @@
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
from time import time
|
from time import time
|
||||||
import uuid
|
|
||||||
|
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
|
from oslo_utils import uuidutils
|
||||||
|
|
||||||
from vmware_nsxlib._i18n import _
|
from vmware_nsxlib._i18n import _
|
||||||
from vmware_nsxlib.v3 import exceptions as nsxlib_exceptions
|
from vmware_nsxlib.v3 import exceptions as nsxlib_exceptions
|
||||||
|
@ -156,7 +156,7 @@ class ClientCertificateManager(object):
|
||||||
subject)
|
subject)
|
||||||
|
|
||||||
# register on backend
|
# register on backend
|
||||||
self._register_cert(cert, node_id or uuid.uuid4())
|
self._register_cert(cert, node_id or uuidutils.generate_uuid())
|
||||||
|
|
||||||
# save in storage
|
# save in storage
|
||||||
cert_pem = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
|
cert_pem = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
|
||||||
|
@ -224,7 +224,7 @@ class ClientCertificateManager(object):
|
||||||
|
|
||||||
cert = self._get_cert_from_file(filename)
|
cert = self._get_cert_from_file(filename)
|
||||||
# register on backend
|
# register on backend
|
||||||
self._register_cert(cert, node_id or uuid.uuid4())
|
self._register_cert(cert, node_id or uuidutils.generate_uuid())
|
||||||
|
|
||||||
cert_pem = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
|
cert_pem = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
|
||||||
self._storage_driver.store_cert(self._identity, cert_pem, None)
|
self._storage_driver.store_cert(self._identity, cert_pem, None)
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import uuid
|
|
||||||
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
from oslo_utils import uuidutils
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from vmware_nsxlib._i18n import _
|
from vmware_nsxlib._i18n import _
|
||||||
|
@ -62,7 +62,7 @@ class NsxPolicyResourceBase(object):
|
||||||
def _init_obj_uuid(obj_uuid):
|
def _init_obj_uuid(obj_uuid):
|
||||||
if not obj_uuid:
|
if not obj_uuid:
|
||||||
# generate a random id
|
# generate a random id
|
||||||
obj_uuid = str(uuid.uuid4())
|
obj_uuid = str(uuidutils.generate_uuid())
|
||||||
return obj_uuid
|
return obj_uuid
|
||||||
|
|
||||||
def _canonize_name(self, name):
|
def _canonize_name(self, name):
|
||||||
|
|
Loading…
Reference in New Issue