]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Use oslo.utils
authorChangBo Guo(gcb) <eric.guo@easystack.cn>
Mon, 10 Nov 2014 08:53:18 +0000 (16:53 +0800)
committerChangBo Guo(gcb) <eric.guo@easystack.cn>
Thu, 20 Nov 2014 14:17:47 +0000 (22:17 +0800)
oslo.utils library now provides the functionality previously in
oslo-incubator's excutils, importutils, network_utils, strutils
timeutils, units etc. Some of these outdated modules will still be
around for a while until all other oslo modules that use them have been
updated in future commits.

Change-Id: Idee8600dfe42e5977b8fb824e91afff7e9119981

152 files changed:
cinder/api/contrib/admin_actions.py
cinder/api/contrib/hosts.py
cinder/api/contrib/qos_specs_manage.py
cinder/api/contrib/quotas.py
cinder/api/contrib/services.py
cinder/api/contrib/volume_actions.py
cinder/api/extensions.py
cinder/api/v1/limits.py
cinder/api/v1/snapshots.py
cinder/api/v2/limits.py
cinder/api/v2/snapshots.py
cinder/api/views/limits.py
cinder/backup/__init__.py
cinder/backup/api.py
cinder/backup/drivers/ceph.py
cinder/backup/drivers/swift.py
cinder/backup/manager.py
cinder/brick/local_dev/lvm.py
cinder/compute/__init__.py
cinder/consistencygroup/__init__.py
cinder/consistencygroup/api.py
cinder/context.py
cinder/db/base.py
cinder/db/sqlalchemy/api.py
cinder/db/sqlalchemy/models.py
cinder/image/glance.py
cinder/image/image_utils.py
cinder/keymgr/__init__.py
cinder/keymgr/barbican.py
cinder/openstack/common/network_utils.py [deleted file]
cinder/openstack/common/units.py [deleted file]
cinder/quota.py
cinder/replication/__init__.py
cinder/scheduler/driver.py
cinder/scheduler/flows/create_volume.py
cinder/scheduler/host_manager.py
cinder/scheduler/manager.py
cinder/scheduler/scheduler_options.py
cinder/service.py
cinder/test.py
cinder/tests/api/contrib/test_admin_actions.py
cinder/tests/api/contrib/test_availability_zones.py
cinder/tests/api/contrib/test_backups.py
cinder/tests/api/contrib/test_hosts.py
cinder/tests/api/contrib/test_services.py
cinder/tests/api/fakes.py
cinder/tests/api/v1/test_types.py
cinder/tests/api/v2/test_types.py
cinder/tests/scheduler/fakes.py
cinder/tests/scheduler/test_host_manager.py
cinder/tests/scheduler/test_scheduler.py
cinder/tests/test_backup.py
cinder/tests/test_coraid.py
cinder/tests/test_drivers_compatibility.py
cinder/tests/test_fusionio_ioControl.py
cinder/tests/test_glusterfs.py
cinder/tests/test_gpfs.py
cinder/tests/test_hp3par.py
cinder/tests/test_hplefthand.py
cinder/tests/test_ibmnas.py
cinder/tests/test_image_utils.py
cinder/tests/test_nexenta.py
cinder/tests/test_nfs.py
cinder/tests/test_prophetstor_dpl.py
cinder/tests/test_pure.py
cinder/tests/test_quota.py
cinder/tests/test_rbd.py
cinder/tests/test_replication.py
cinder/tests/test_scality.py
cinder/tests/test_sheepdog.py
cinder/tests/test_solidfire.py
cinder/tests/test_storwize_svc.py
cinder/tests/test_utils.py
cinder/tests/test_vmware_datastore.py
cinder/tests/test_vmware_vmdk.py
cinder/tests/test_vmware_volumeops.py
cinder/tests/test_volume.py
cinder/tests/test_volume_utils.py
cinder/tests/test_zfssa.py
cinder/tests/zonemanager/test_brcd_fc_zone_driver.py
cinder/tests/zonemanager/test_cisco_fc_zone_driver.py
cinder/transfer/__init__.py
cinder/transfer/api.py
cinder/utils.py
cinder/volume/__init__.py
cinder/volume/api.py
cinder/volume/driver.py
cinder/volume/drivers/coraid.py
cinder/volume/drivers/datera.py
cinder/volume/drivers/emc/emc_vnx_cli.py
cinder/volume/drivers/eqlx.py
cinder/volume/drivers/fujitsu_eternus_dx_common.py
cinder/volume/drivers/fusionio/ioControl.py
cinder/volume/drivers/glusterfs.py
cinder/volume/drivers/hds/hds.py
cinder/volume/drivers/hds/hnas_backend.py
cinder/volume/drivers/hds/iscsi.py
cinder/volume/drivers/hds/nfs.py
cinder/volume/drivers/hitachi/hbsd_basiclib.py
cinder/volume/drivers/hitachi/hbsd_common.py
cinder/volume/drivers/hitachi/hbsd_fc.py
cinder/volume/drivers/hitachi/hbsd_horcm.py
cinder/volume/drivers/huawei/rest_common.py
cinder/volume/drivers/huawei/ssh_common.py
cinder/volume/drivers/ibm/gpfs.py
cinder/volume/drivers/ibm/ibmnas.py
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/ibm/storwize_svc/helpers.py
cinder/volume/drivers/ibm/xiv_ds8k.py
cinder/volume/drivers/lvm.py
cinder/volume/drivers/netapp/common.py
cinder/volume/drivers/netapp/eseries/iscsi.py
cinder/volume/drivers/netapp/iscsi.py
cinder/volume/drivers/netapp/nfs.py
cinder/volume/drivers/netapp/ssc_utils.py
cinder/volume/drivers/netapp/utils.py
cinder/volume/drivers/nexenta/nfs.py
cinder/volume/drivers/nexenta/utils.py
cinder/volume/drivers/nfs.py
cinder/volume/drivers/nimble.py
cinder/volume/drivers/prophetstor/dplcommon.py
cinder/volume/drivers/pure.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/remotefs.py
cinder/volume/drivers/san/hp/hp_3par_common.py
cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py
cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py
cinder/volume/drivers/san/san.py
cinder/volume/drivers/scality.py
cinder/volume/drivers/sheepdog.py
cinder/volume/drivers/smbfs.py
cinder/volume/drivers/solidfire.py
cinder/volume/drivers/vmware/datastore.py
cinder/volume/drivers/vmware/vmdk.py
cinder/volume/drivers/vmware/volumeops.py
cinder/volume/drivers/windows/smbfs.py
cinder/volume/drivers/zfssa/zfssaiscsi.py
cinder/volume/flows/api/create_volume.py
cinder/volume/flows/manager/create_volume.py
cinder/volume/manager.py
cinder/volume/utils.py
cinder/wsgi.py
cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py
cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py
cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py
cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py
cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py
cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py
cinder/zonemanager/fc_san_lookup_service.py
cinder/zonemanager/fc_zone_manager.py
openstack-common.conf
requirements.txt

index 16fe9902dcd01f20d34b1dc682fc09458db9332f..964af7b3802f256057b2685a34b53f91372228d7 100644 (file)
@@ -12,6 +12,7 @@
 #   License for the specific language governing permissions and limitations
 #   under the License.
 
+from oslo.utils import strutils
 import webob
 from webob import exc
 
@@ -22,7 +23,6 @@ from cinder import db
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
 from cinder import rpc
 from cinder import volume
 
index af458bfae289251ca82f9bb2837187e48bb59021..47bd6b06fef4bb565fe68d6e790dd32a51344769 100644 (file)
@@ -18,6 +18,7 @@
 from xml.parsers import expat
 
 from oslo.config import cfg
+from oslo.utils import timeutils
 import webob.exc
 
 from cinder.api import extensions
@@ -27,7 +28,6 @@ from cinder import db
 from cinder import exception
 from cinder.i18n import _, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder.volume import api as volume_api
 
index b48ce41b4fb21a53a1f48eb8300d44b1fe92fb33..062d1f6d679bc4eeb7a733427febe38e677c82da 100644 (file)
@@ -15,6 +15,7 @@
 
 """The QoS specs extension"""
 
+from oslo.utils import strutils
 import six
 import webob
 
@@ -25,7 +26,6 @@ from cinder.api import xmlutil
 from cinder import exception
 from cinder.i18n import _, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
 from cinder import rpc
 from cinder import utils
 from cinder.volume import qos_specs
index a7de8d5366c5f3980c6e2aecd609793f7d66284a..121224fefdc6942fb902075ae174157215ad5306 100644 (file)
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo.utils import strutils
 import webob
 
 from cinder.api import extensions
@@ -22,7 +23,6 @@ from cinder import db
 from cinder.db.sqlalchemy import api as sqlalchemy_api
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import strutils
 from cinder import quota
 
 
index 88a408699017329f5b5c2a9506c15a26b9ce089d..0e58d65f2440209c41495afc073ca0f38f31fec4 100644 (file)
@@ -15,6 +15,7 @@
 
 
 from oslo.config import cfg
+from oslo.utils import timeutils
 import webob.exc
 
 from cinder.api import extensions
@@ -24,7 +25,6 @@ from cinder import db
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import utils
 
 
index 24dcb9cf47d3081b9466f550f97248045c9279b6..fd4bc1f8b08e57129692b5e77235b3b659374ca1 100644 (file)
@@ -14,6 +14,7 @@
 
 
 from oslo import messaging
+from oslo.utils import strutils
 import webob
 
 from cinder.api import extensions
@@ -22,7 +23,6 @@ from cinder.api import xmlutil
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
 from cinder import utils
 from cinder import volume
 
index c37b5070255eb1ce7cceaacb4181767ceb46464d..6eff5abedff2947e5b446efe9844d02edc44b73e 100644 (file)
@@ -17,6 +17,7 @@
 import os
 
 from oslo.config import cfg
+from oslo.utils import importutils
 import webob.dec
 import webob.exc
 
@@ -25,7 +26,6 @@ from cinder.api.openstack import wsgi
 from cinder.api import xmlutil
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 import cinder.policy
 
index de45e99aac7418937a9f4198f0e3b2f2665eedc9..0f44c7b7b4ee668fea2e0dcddc38f18e29e2f580 100644 (file)
@@ -25,6 +25,7 @@ import re
 import time
 
 from oslo.serialization import jsonutils
+from oslo.utils import importutils
 import webob.dec
 import webob.exc
 
@@ -32,7 +33,6 @@ from cinder.api.openstack import wsgi
 from cinder.api.views import limits as limits_views
 from cinder.api import xmlutil
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder import quota
 from cinder import wsgi as base_wsgi
 
index 918dcb35943d24d4559589599b987fd223176215..016d1e44701d1b7113361393bee78e2452e1fb3c 100644 (file)
@@ -15,6 +15,7 @@
 
 """The volumes snapshots api."""
 
+from oslo.utils import strutils
 import webob
 from webob import exc
 
@@ -24,7 +25,6 @@ from cinder.api import xmlutil
 from cinder import exception
 from cinder.i18n import _, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
 from cinder import utils
 from cinder import volume
 
index 5fba22076c9c84a1e066737c613448d6d6bdd288..e89393d900b14cb768abf0ac44fbfe5c50c2283f 100644 (file)
@@ -25,6 +25,7 @@ import re
 import time
 
 from oslo.serialization import jsonutils
+from oslo.utils import importutils
 import webob.dec
 import webob.exc
 
@@ -32,7 +33,6 @@ from cinder.api.openstack import wsgi
 from cinder.api.views import limits as limits_views
 from cinder.api import xmlutil
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder import quota
 from cinder import wsgi as base_wsgi
 
index f7c76b9ccee6891bdef66ade476c1e2f00883daf..64d1d28436724df1df814393b20084288e26703c 100644 (file)
@@ -15,6 +15,7 @@
 
 """The volumes snapshots api."""
 
+from oslo.utils import strutils
 import webob
 from webob import exc
 
@@ -24,7 +25,6 @@ from cinder.api import xmlutil
 from cinder import exception
 from cinder.i18n import _, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
 from cinder import utils
 from cinder import volume
 
index dba14d6efe27c81755b7006cdc0df834f24301fe..b676f10efee32ca903af1123abb4f38072e8331f 100644 (file)
@@ -15,7 +15,7 @@
 
 import datetime
 
-from cinder.openstack.common import timeutils
+from oslo.utils import timeutils
 
 
 class ViewBuilder(object):
index 354580f362e8d14115bcca88f21ac278cbf7d02b..7482eb458a5863d98181edd458e3a7f989a6a66a 100644 (file)
 # Importing full names to not pollute the namespace and cause possible
 # collisions with use of 'from cinder.backup import <foo>' elsewhere.
 
+from oslo.utils import importutils
 
 from cinder.common import config
-import cinder.openstack.common.importutils
 
 
 CONF = config.CONF
 
-API = cinder.openstack.common.importutils.import_class(CONF.backup_api_class)
+API = importutils.import_class(CONF.backup_api_class)
index 094c0313bc943bc17c0a8455dd5b082b15b96fd2..2b52d6d2ae48b57550e955efb3d59da500abd88b 100644 (file)
@@ -20,13 +20,13 @@ Handles all requests relating to the volume backups service.
 
 from eventlet import greenthread
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder.backup import rpcapi as backup_rpcapi
 from cinder import context
 from cinder.db import base
 from cinder import exception
 from cinder.i18n import _, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 import cinder.policy
 from cinder import quota
index d36e22f579fac61617b6c0c1f3446486b5a088d3..86b969213d38bb77dced5852a820738579096aec 100644 (file)
@@ -50,14 +50,14 @@ import time
 
 import eventlet
 from oslo.config import cfg
+from oslo.utils import encodeutils
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder.backup.driver import BackupDriver
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
-from cinder.openstack.common import units
 from cinder import utils
 import cinder.volume.drivers.rbd as rbd_driver
 
@@ -103,7 +103,7 @@ class VolumeMetadataBackup(object):
 
     @property
     def name(self):
-        return strutils.safe_encode("backup.%s.meta" % self._backup_id)
+        return encodeutils.safe_encode("backup.%s.meta" % self._backup_id)
 
     @property
     def exists(self):
@@ -182,9 +182,9 @@ class CephBackupDriver(BackupDriver):
             self.rbd_stripe_count = 0
             self.rbd_stripe_unit = 0
 
-        self._ceph_backup_user = strutils.safe_encode(CONF.backup_ceph_user)
-        self._ceph_backup_pool = strutils.safe_encode(CONF.backup_ceph_pool)
-        self._ceph_backup_conf = strutils.safe_encode(CONF.backup_ceph_conf)
+        self._ceph_backup_user = encodeutils.safe_encode(CONF.backup_ceph_user)
+        self._ceph_backup_pool = encodeutils.safe_encode(CONF.backup_ceph_pool)
+        self._ceph_backup_conf = encodeutils.safe_encode(CONF.backup_ceph_conf)
 
     def _validate_string_args(self, *args):
         """Ensure all args are non-None and non-empty."""
@@ -240,7 +240,8 @@ class CephBackupDriver(BackupDriver):
                                   conffile=self._ceph_backup_conf)
         try:
             client.connect()
-            pool_to_open = strutils.safe_encode(pool or self._ceph_backup_pool)
+            pool_to_open = encodeutils.safe_encode(pool or
+                                                   self._ceph_backup_pool)
             ioctx = client.open_ioctx(pool_to_open)
             return client, ioctx
         except self.rados.Error:
@@ -263,13 +264,13 @@ class CephBackupDriver(BackupDriver):
         """
         # Ensure no unicode
         if diff_format:
-            return strutils.safe_encode("volume-%s.backup.base" % volume_id)
+            return encodeutils.safe_encode("volume-%s.backup.base" % volume_id)
         else:
             if backup_id is None:
                 msg = _("Backup id required")
                 raise exception.InvalidParameterValue(msg)
-            return strutils.safe_encode("volume-%s.backup.%s" %
-                                        (volume_id, backup_id))
+            return encodeutils.safe_encode("volume-%s.backup.%s" %
+                                           (volume_id, backup_id))
 
     def _discard_bytes(self, volume, offset, length):
         """Trim length bytes from offset.
@@ -472,7 +473,7 @@ class CephBackupDriver(BackupDriver):
 
             # Since we have deleted the base image we can delete the source
             # volume backup snapshot.
-            src_name = strutils.safe_encode(volume_id)
+            src_name = encodeutils.safe_encode(volume_id)
             if src_name in self.rbd.RBD().list(client.ioctx):
                 LOG.debug("Deleting source volume snapshot '%(snapshot)s' "
                           "for backup %(basename)s." %
@@ -537,15 +538,15 @@ class CephBackupDriver(BackupDriver):
         if from_snap is not None:
             cmd1.extend(['--from-snap', from_snap])
         if src_snap:
-            path = strutils.safe_encode("%s/%s@%s" %
-                                        (src_pool, src_name, src_snap))
+            path = encodeutils.safe_encode("%s/%s@%s" %
+                                           (src_pool, src_name, src_snap))
         else:
-            path = strutils.safe_encode("%s/%s" % (src_pool, src_name))
+            path = encodeutils.safe_encode("%s/%s" % (src_pool, src_name))
 
         cmd1.extend([path, '-'])
 
         cmd2 = ['rbd', 'import-diff'] + dest_ceph_args
-        rbd_path = strutils.safe_encode("%s/%s" % (dest_pool, dest_name))
+        rbd_path = encodeutils.safe_encode("%s/%s" % (dest_pool, dest_name))
         cmd2.extend(['-', rbd_path])
 
         ret, stderr = self._piped_execute(cmd1, cmd2)
@@ -758,8 +759,8 @@ class CephBackupDriver(BackupDriver):
         return backup_snaps
 
     def _get_new_snap_name(self, backup_id):
-        return strutils.safe_encode("backup.%s.snap.%s" %
-                                    (backup_id, time.time()))
+        return encodeutils.safe_encode("backup.%s.snap.%s" %
+                                       (backup_id, time.time()))
 
     def _get_backup_snap_name(self, rbd_image, name, backup_id):
         """Return the name of the snapshot associated with backup_id.
@@ -933,7 +934,7 @@ class CephBackupDriver(BackupDriver):
         with rbd_driver.RADOSClient(self, self._ceph_backup_pool) as client:
             adjust_size = 0
             base_image = self.rbd.Image(client.ioctx,
-                                        strutils.safe_encode(backup_base),
+                                        encodeutils.safe_encode(backup_base),
                                         read_only=True)
             try:
                 if restore_length != base_image.size():
@@ -943,8 +944,8 @@ class CephBackupDriver(BackupDriver):
 
         if adjust_size:
             with rbd_driver.RADOSClient(self, src_pool) as client:
-                dest_image = self.rbd.Image(client.ioctx,
-                                            strutils.safe_encode(restore_vol))
+                restore_vol_encode = encodeutils.safe_encode(restore_vol)
+                dest_image = self.rbd.Image(client.ioctx, restore_vol_encode)
                 try:
                     LOG.debug("Adjusting restore vol size")
                     dest_image.resize(adjust_size)
index d98f0de39c40d4dc38bff8fa43ec603c8bdc8eba..5fb423d159e92ee093c50889d312b4de1c350700 100644 (file)
@@ -38,16 +38,16 @@ import socket
 
 import eventlet
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import timeutils
+from oslo.utils import units
 import six
 from swiftclient import client as swift
 
 from cinder.backup.driver import BackupDriver
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 
 LOG = logging.getLogger(__name__)
 
index 80b72bfed7b45095f72c35b4b23a78747567a462..5ca7b7b39d6242c77ceb5ee80bbedb71a9b2aad2 100644 (file)
@@ -35,6 +35,8 @@ Volume backups can be created, restored, deleted and listed.
 
 from oslo.config import cfg
 from oslo import messaging
+from oslo.utils import excutils
+from oslo.utils import importutils
 
 from cinder.backup import driver
 from cinder.backup import rpcapi as backup_rpcapi
@@ -42,8 +44,6 @@ from cinder import context
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
 from cinder import manager
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder import quota
 from cinder import rpc
index 562fd761a620bc2b607521293ad9e06b10d73161..2612b9bc8086654d0ef50ba74945ce5cd36ace79 100644 (file)
@@ -22,10 +22,11 @@ import math
 import re
 import time
 
+from oslo.utils import excutils
+
 from cinder.brick import exception
 from cinder.brick import executor
 from cinder.i18n import _, _LE, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
 
index c70d14109994e19c81e064e31aa2a91d7a28fe7a..b3cdf137ab31c61ee973fc959c7181e53de4d994 100644 (file)
@@ -14,8 +14,8 @@
 #    under the License.
 
 import oslo.config.cfg
+from oslo.utils import importutils
 
-import cinder.openstack.common.importutils
 
 _compute_opts = [
     oslo.config.cfg.StrOpt('compute_api_class',
@@ -28,7 +28,6 @@ oslo.config.cfg.CONF.register_opts(_compute_opts)
 
 
 def API():
-    importutils = cinder.openstack.common.importutils
     compute_api_class = oslo.config.cfg.CONF.compute_api_class
     cls = importutils.import_class(compute_api_class)
     return cls()
index f89791d320d761b068c5a75f9091143609fa6647..efa3bc0e12eb2fb2551440a187dbe8f1cd2cf95e 100644 (file)
 # Importing full names to not pollute the namespace and cause possible
 # collisions with use of 'from cinder.transfer import <foo>' elsewhere.
 
+from oslo.utils import importutils
 
 from cinder.common import config
-import cinder.openstack.common.importutils
 
 
 CONF = config.CONF
 
-API = cinder.openstack.common.importutils.import_class(
+API = importutils.import_class(
     CONF.consistencygroup_api_class)
index a4dfead0fbe174019c6c1ead8cfd40563f4924d2..fb55e74eca0d45df3af231bbffe3924e05ab854c 100644 (file)
@@ -21,13 +21,13 @@ Handles all requests relating to consistency groups.
 import functools
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import timeutils
 
 from cinder.db import base
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 import cinder.policy
 from cinder import quota
 from cinder.scheduler import rpcapi as scheduler_rpcapi
index 5a826891f9df7f5834fecba407ebdc8bd6baf78d..a67c6426f60d47f64f600556cde8561ba6074646 100644 (file)
 import copy
 import uuid
 
+from oslo.utils import timeutils
+
 from cinder.i18n import _
 from cinder.openstack.common import local
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import policy
 
 
index da51fdde13d7d2ec5d5f5df637d5299b095ba2ea..3ba467467ca489685904fa18932fd4a7d5fbff7d 100644 (file)
@@ -18,8 +18,7 @@
 
 
 from oslo.config import cfg
-
-from cinder.openstack.common import importutils
+from oslo.utils import importutils
 
 
 db_driver_opt = cfg.StrOpt('db_driver',
index da249da26c7f3c99ddf7792b7d3d8c7c698d11aa..b37e35c5731ef3f9103254a484921ba0deee43c0 100644 (file)
@@ -30,6 +30,7 @@ from oslo.config import cfg
 from oslo.db import exception as db_exc
 from oslo.db import options
 from oslo.db.sqlalchemy import session as db_session
+from oslo.utils import timeutils
 import osprofiler.sqlalchemy
 import sqlalchemy
 from sqlalchemy import or_
@@ -43,7 +44,6 @@ from cinder.db.sqlalchemy import models
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder.openstack.common import uuidutils
 
 
index 6ae1505bcd99df340afcb7075571327f04847c3b..2c5b8d079f586667c9e258ccfab4479610526e99 100644 (file)
@@ -21,13 +21,12 @@ SQLAlchemy models for cinder data.
 
 from oslo.config import cfg
 from oslo.db.sqlalchemy import models
+from oslo.utils import timeutils
 from sqlalchemy import Column, Integer, String, Text, schema
 from sqlalchemy.ext.declarative import declarative_base
 from sqlalchemy import ForeignKey, DateTime, Boolean
 from sqlalchemy.orm import relationship, backref, validates
 
-from cinder.openstack.common import timeutils
-
 
 CONF = cfg.CONF
 BASE = declarative_base()
index 1a1334069c5af5b993cd6d8830028b891db30364..efed24aac021fb215da0d9393e950e19e6b7d1cb 100644 (file)
@@ -29,12 +29,13 @@ import time
 import glanceclient.exc
 from oslo.config import cfg
 from oslo.serialization import jsonutils
+from oslo.utils import timeutils
 import six.moves.urllib.parse as urlparse
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
+
 
 glance_opts = [
     cfg.ListOpt('allowed_direct_url_schemes',
index 3d280a3ca41c4bdb80bf5f3a17ec2ecfcdc18181..ebd89b8985dfe8153aff7b26726e817d67c92853 100644 (file)
@@ -29,6 +29,8 @@ import os
 import tempfile
 
 from oslo.config import cfg
+from oslo.utils import timeutils
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
@@ -36,8 +38,6 @@ from cinder.openstack.common import fileutils
 from cinder.openstack.common import imageutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume import utils as volume_utils
 
index 84daca4e53ce1fba518908323f2d65b570e5247d..d1123081738c5608b66e71ee7db019c08727e9b3 100644 (file)
@@ -14,8 +14,7 @@
 #    under the License.
 
 from oslo.config import cfg
-
-from cinder.openstack.common import importutils
+from oslo.utils import importutils
 
 keymgr_opts = [
     cfg.StrOpt('api_class',
index afbf41cd0d7544729f5e823e340117b50daa97ac..d32e4d8327c1a874b5c13a1dc6332ada368c0d76 100644 (file)
@@ -25,12 +25,12 @@ from barbicanclient import client as barbican_client
 from keystoneclient.auth import identity
 from keystoneclient import session
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.keymgr import key as keymgr_key
 from cinder.keymgr import key_mgr
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 
 CONF = cfg.CONF
diff --git a/cinder/openstack/common/network_utils.py b/cinder/openstack/common/network_utils.py
deleted file mode 100644 (file)
index 7672116..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-# Copyright 2012 OpenStack Foundation.
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-"""
-Network-related utilities and helper functions.
-"""
-
-import socket
-
-from six.moves.urllib import parse
-
-from cinder.openstack.common.gettextutils import _LW
-from cinder.openstack.common import log as logging
-
-LOG = logging.getLogger(__name__)
-
-
-def parse_host_port(address, default_port=None):
-    """Interpret a string as a host:port pair.
-
-    An IPv6 address MUST be escaped if accompanied by a port,
-    because otherwise ambiguity ensues: 2001:db8:85a3::8a2e:370:7334
-    means both [2001:db8:85a3::8a2e:370:7334] and
-    [2001:db8:85a3::8a2e:370]:7334.
-
-    >>> parse_host_port('server01:80')
-    ('server01', 80)
-    >>> parse_host_port('server01')
-    ('server01', None)
-    >>> parse_host_port('server01', default_port=1234)
-    ('server01', 1234)
-    >>> parse_host_port('[::1]:80')
-    ('::1', 80)
-    >>> parse_host_port('[::1]')
-    ('::1', None)
-    >>> parse_host_port('[::1]', default_port=1234)
-    ('::1', 1234)
-    >>> parse_host_port('2001:db8:85a3::8a2e:370:7334', default_port=1234)
-    ('2001:db8:85a3::8a2e:370:7334', 1234)
-
-    """
-    if address[0] == '[':
-        # Escaped ipv6
-        _host, _port = address[1:].split(']')
-        host = _host
-        if ':' in _port:
-            port = _port.split(':')[1]
-        else:
-            port = default_port
-    else:
-        if address.count(':') == 1:
-            host, port = address.split(':')
-        else:
-            # 0 means ipv4, >1 means ipv6.
-            # We prohibit unescaped ipv6 addresses with port.
-            host = address
-            port = default_port
-
-    return (host, None if port is None else int(port))
-
-
-class ModifiedSplitResult(parse.SplitResult):
-    """Split results class for urlsplit."""
-
-    # NOTE(dims): The functions below are needed for Python 2.6.x.
-    # We can remove these when we drop support for 2.6.x.
-    @property
-    def hostname(self):
-        netloc = self.netloc.split('@', 1)[-1]
-        host, port = parse_host_port(netloc)
-        return host
-
-    @property
-    def port(self):
-        netloc = self.netloc.split('@', 1)[-1]
-        host, port = parse_host_port(netloc)
-        return port
-
-
-def urlsplit(url, scheme='', allow_fragments=True):
-    """Parse a URL using urlparse.urlsplit(), splitting query and fragments.
-    This function papers over Python issue9374 when needed.
-
-    The parameters are the same as urlparse.urlsplit.
-    """
-    scheme, netloc, path, query, fragment = parse.urlsplit(
-        url, scheme, allow_fragments)
-    if allow_fragments and '#' in path:
-        path, fragment = path.split('#', 1)
-    if '?' in path:
-        path, query = path.split('?', 1)
-    return ModifiedSplitResult(scheme, netloc,
-                               path, query, fragment)
-
-
-def set_tcp_keepalive(sock, tcp_keepalive=True,
-                      tcp_keepidle=None,
-                      tcp_keepalive_interval=None,
-                      tcp_keepalive_count=None):
-    """Set values for tcp keepalive parameters
-
-    This function configures tcp keepalive parameters if users wish to do
-    so.
-    :param tcp_keepalive: Boolean, turn on or off tcp_keepalive. If users are
-      not sure, this should be True, and default values will be used.
-
-    :param tcp_keepidle: time to wait before starting to send keepalive probes
-
-    :param tcp_keepalive_interval: time between successive probes, once the
-      initial wait time is over
-
-    :param tcp_keepalive_count: number of probes to send before the connection
-      is killed
-    """
-
-    # NOTE(praneshp): Despite keepalive being a tcp concept, the level is
-    # still SOL_SOCKET. This is a quirk.
-    if isinstance(tcp_keepalive, bool):
-        sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, tcp_keepalive)
-    else:
-        raise TypeError("tcp_keepalive must be a boolean")
-
-    if not tcp_keepalive:
-        return
-
-    # These options aren't available in the OS X version of eventlet,
-    # Idle + Count * Interval effectively gives you the total timeout.
-    if tcp_keepidle is not None:
-        if hasattr(socket, 'TCP_KEEPIDLE'):
-            sock.setsockopt(socket.IPPROTO_TCP,
-                            socket.TCP_KEEPIDLE,
-                            tcp_keepidle)
-        else:
-            LOG.warning(_LW('tcp_keepidle not available on your system'))
-    if tcp_keepalive_interval is not None:
-        if hasattr(socket, 'TCP_KEEPINTVL'):
-            sock.setsockopt(socket.IPPROTO_TCP,
-                            socket.TCP_KEEPINTVL,
-                            tcp_keepalive_interval)
-        else:
-            LOG.warning(_LW('tcp_keepintvl not available on your system'))
-    if tcp_keepalive_count is not None:
-        if hasattr(socket, 'TCP_KEEPCNT'):
-            sock.setsockopt(socket.IPPROTO_TCP,
-                            socket.TCP_KEEPCNT,
-                            tcp_keepalive_count)
-        else:
-            LOG.warning(_LW('tcp_keepknt not available on your system'))
diff --git a/cinder/openstack/common/units.py b/cinder/openstack/common/units.py
deleted file mode 100644 (file)
index 84b518c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 IBM Corp
-# All Rights Reserved.
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-"""
-Unit constants
-"""
-
-#Binary unit constants.
-Ki = 1024
-Mi = 1024 ** 2
-Gi = 1024 ** 3
-Ti = 1024 ** 4
-Pi = 1024 ** 5
-Ei = 1024 ** 6
-Zi = 1024 ** 7
-Yi = 1024 ** 8
-
-#Decimal unit constants.
-k = 1000
-M = 1000 ** 2
-G = 1000 ** 3
-T = 1000 ** 4
-P = 1000 ** 5
-E = 1000 ** 6
-Z = 1000 ** 7
-Y = 1000 ** 8
index 6300887476012f2797fb707c43418e4598851ee0..84756ef7f6e6ee93f34dca794b18ba721521126c 100644 (file)
 import datetime
 
 from oslo.config import cfg
+from oslo.utils import importutils
+from oslo.utils import timeutils
 
 from cinder import context
 from cinder import db
 from cinder import exception
 from cinder.i18n import _, _LE
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 
 
 LOG = logging.getLogger(__name__)
index 99f16a32a1a300a205039fc9487e37f0f8b50205..a4260e809c82157990f4d7e0909873e04b27bd37 100644 (file)
 
 
 from oslo.config import cfg
-
-import cinder.openstack.common.importutils
+from oslo.utils import importutils
 
 
 CONF = cfg.CONF
 
 cls = CONF.replication_api_class
-API = cinder.openstack.common.importutils.import_class(cls)
+API = importutils.import_class(cls)
index 7749e3671fc6f7fb19af43f94e4ca1b7eb4541c6..927846c394b9da19562692a889d44efea03e6677 100644 (file)
@@ -20,11 +20,11 @@ Scheduler base class that all Schedulers should inherit from
 """
 
 from oslo.config import cfg
+from oslo.utils import importutils
+from oslo.utils import timeutils
 
 from cinder import db
 from cinder.i18n import _
-from cinder.openstack.common import importutils
-from cinder.openstack.common import timeutils
 from cinder.volume import rpcapi as volume_rpcapi
 
 
index 43007a4edce0880ff42cc6600cef5f33d7fb202f..4e9fcfcd3dc65a25e0f501002cb0972b4eaedadc 100644 (file)
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+from oslo.utils import excutils
 import taskflow.engines
 from taskflow.patterns import linear_flow
 
 from cinder import exception
 from cinder import flow_utils
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import rpc
 from cinder import utils
index 4729e235563b1cc09b78427c282cd629353c18a2..c7c7cdfeee72c45cb8e028b95ab8cd4fb548f11f 100644 (file)
@@ -20,6 +20,7 @@ Manage hosts in the current zone.
 import UserDict
 
 from oslo.config import cfg
+from oslo.utils import timeutils
 
 from cinder import db
 from cinder import exception
@@ -27,7 +28,6 @@ from cinder.i18n import _
 from cinder.openstack.common import log as logging
 from cinder.openstack.common.scheduler import filters
 from cinder.openstack.common.scheduler import weights
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder.volume import utils as vol_utils
 
index 6db095b57e9b8be519ceb0b763642363f5912148..0aeddd6ffea466ad39829d4df606669489033955 100644 (file)
@@ -21,6 +21,8 @@ Scheduler Service
 
 from oslo.config import cfg
 from oslo import messaging
+from oslo.utils import excutils
+from oslo.utils import importutils
 
 from cinder import context
 from cinder import db
@@ -28,8 +30,6 @@ from cinder import exception
 from cinder import flow_utils
 from cinder.i18n import _
 from cinder import manager
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder import quota
 from cinder import rpc
index 661e899eae7b3f96a0c34e374bd5df970c89ed6a..970bb6068983765c72a1ae45aca37762fc946663 100644 (file)
@@ -25,10 +25,10 @@ import json
 import os
 
 from oslo.config import cfg
+from oslo.utils import timeutils
 
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 
 
 scheduler_json_config_location_opt = cfg.StrOpt(
index 2378c59177775cdb58f608fe3f4d45151654ddf8..bfd2f8979369bdbc981f474bdcc83f2d4ece17a1 100644 (file)
@@ -25,6 +25,7 @@ import random
 from oslo.config import cfg
 from oslo.db import exception as db_exc
 from oslo import messaging
+from oslo.utils import importutils
 import osprofiler.notifier
 from osprofiler import profiler
 import osprofiler.web
@@ -33,7 +34,6 @@ from cinder import context
 from cinder import db
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
 from cinder.openstack.common import processutils
index 46abeb90cf1c237d6a2d316c5519872157efc78c..16d4860a09948f5cb6e475be4896e915f1286107 100644 (file)
@@ -32,6 +32,8 @@ import mock
 import mox
 from oslo.config import cfg
 from oslo.messaging import conffixture as messaging_conffixture
+from oslo.utils import strutils
+from oslo.utils import timeutils
 import stubout
 import testtools
 from testtools import matchers
@@ -40,8 +42,6 @@ from cinder.common import config  # noqa Need to register global_opts
 from cinder.db import migration
 from cinder.db.sqlalchemy import api as sqla_api
 from cinder.openstack.common import log as oslo_logging
-from cinder.openstack.common import strutils
-from cinder.openstack.common import timeutils
 from cinder import rpc
 from cinder import service
 from cinder.tests import conf_fixture
index e9da48fde62cb42a4173a7020f63c588db3b8e6a..727f407d6b3002666e4bbf6e53a604b01aa705cb 100644 (file)
@@ -15,6 +15,7 @@ import tempfile
 
 from oslo.config import cfg
 from oslo.serialization import jsonutils
+from oslo.utils import timeutils
 import webob
 from webob import exc
 
@@ -23,7 +24,6 @@ from cinder.brick.local_dev import lvm as brick_lvm
 from cinder import context
 from cinder import db
 from cinder import exception
-from cinder.openstack.common import timeutils
 from cinder import test
 from cinder.tests.api import fakes
 from cinder.tests.api.v2 import stubs
index 1c2bed8c36105c3c4609fb84bceed7998b51d8e0..06ecd88f470d68237f801db5a6361e70e84c52cb 100644 (file)
 import datetime
 
 from lxml import etree
+from oslo.utils import timeutils
 
 import cinder.api.contrib.availability_zones
 import cinder.context
-from cinder.openstack.common import timeutils
 import cinder.test
 import cinder.volume.api
 
index f41a4f79622df3d35be0372eda77b0d67e04fa16..b6c3a89bb071fd1df40550bf1cb1c0adad0dc344 100644 (file)
@@ -21,6 +21,7 @@ import json
 from xml.dom import minidom
 
 import mock
+from oslo.utils import timeutils
 import webob
 
 # needed for stubs to work
@@ -30,7 +31,6 @@ from cinder import db
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import test
 from cinder.tests.api import fakes
 from cinder.tests import utils
index f43dec3eeb89d77b82d30d5f688f892535b359c2..8e578884801ce532a7171904fbf299c20da83f51 100644 (file)
 import datetime
 
 from lxml import etree
+from oslo.utils import timeutils
 import webob.exc
 
 from cinder.api.contrib import hosts as os_hosts
 from cinder import context
 from cinder import db
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import test
 
 
index 35908849e4fb77779d96a8e819b3fd4f4ed7eb9f..cf26ebd96ef36450c8bcbf508e364e2aa95e4ccc 100644 (file)
@@ -16,6 +16,7 @@
 
 from datetime import datetime
 
+from oslo.utils import timeutils
 import webob.exc
 
 from cinder.api.contrib import services
@@ -23,7 +24,6 @@ from cinder.api import extensions
 from cinder import context
 from cinder import db
 from cinder import exception
-from cinder.openstack.common import timeutils
 from cinder import policy
 from cinder import test
 from cinder.tests.api import fakes
index 24e2c9a280bd3f44e7b7da57d9272461c8abee58..0242a50ce61746d3d09ab287410725997c7a2214 100644 (file)
@@ -15,6 +15,7 @@
 
 import uuid
 
+from oslo.utils import timeutils
 import routes
 import webob
 import webob.dec
@@ -28,7 +29,6 @@ from cinder.api.v2 import limits
 from cinder.api.v2 import router
 from cinder.api import versions
 from cinder import context
-from cinder.openstack.common import timeutils
 from cinder import wsgi
 
 
index 47c80be9846e88051c467f21341f399f97736b0d..844ac9c37d64364f34213846e2d2ef1bf20eb23d 100644 (file)
 import uuid
 
 from lxml import etree
+from oslo.utils import timeutils
 import webob
 
 from cinder.api.v1 import types
 from cinder.api.views import types as views_types
 from cinder import exception
-from cinder.openstack.common import timeutils
 from cinder import test
 from cinder.tests.api import fakes
 from cinder.volume import volume_types
index dc82b1c86ba7367055836aad3aed366ad2f887c5..6d56262a39458bf9e5ad7c27bbd5a0e79b11e85d 100644 (file)
 import uuid
 
 from lxml import etree
+from oslo.utils import timeutils
 import webob
 
 from cinder.api.v2 import types
 from cinder.api.views import types as views_types
 from cinder import exception
-from cinder.openstack.common import timeutils
 from cinder import test
 from cinder.tests.api import fakes
 from cinder.volume import volume_types
index 1ce71c34a4cbf651d15487dbd4a852554d0f3c73..f41c6fb62754664e6adbb52d2b440d033a082e04 100644 (file)
@@ -16,7 +16,8 @@
 Fakes For Scheduler tests.
 """
 
-from cinder.openstack.common import timeutils
+from oslo.utils import timeutils
+
 from cinder.scheduler import filter_scheduler
 from cinder.scheduler import host_manager
 
index acb72726dc589d9f44e7332f66d2f00b6398c2f3..3f51d4bbd96b634924fd8ad3cfd166bbcfb18744 100644 (file)
@@ -18,10 +18,10 @@ Tests For HostManager
 
 import mock
 from oslo.config import cfg
+from oslo.utils import timeutils
 
 from cinder import exception
 from cinder.openstack.common.scheduler import filters
-from cinder.openstack.common import timeutils
 from cinder.scheduler import host_manager
 from cinder import test
 
@@ -84,7 +84,7 @@ class HostManagerTestCase(test.TestCase):
         self.assertEqual(expected, mock_func.call_args_list)
         self.assertEqual(set(result), set(self.fake_hosts))
 
-    @mock.patch('cinder.openstack.common.timeutils.utcnow')
+    @mock.patch('oslo.utils.timeutils.utcnow')
     def test_update_service_capabilities(self, _mock_utcnow):
         service_states = self.host_manager.service_states
         self.assertDictMatch(service_states, {})
index c7497c98c54c93f3248de7668aa5377a9b2855c4..5d55eccfa1abdb2cf8523ad0b8fa768b18d306a8 100644 (file)
@@ -278,7 +278,7 @@ class SchedulerDriverModuleTestCase(test.TestCase):
         self.context = context.RequestContext('fake_user', 'fake_project')
 
     @mock.patch('cinder.db.volume_update')
-    @mock.patch('cinder.openstack.common.timeutils.utcnow')
+    @mock.patch('oslo.utils.timeutils.utcnow')
     def test_volume_host_update_db(self, _mock_utcnow, _mock_vol_update):
         _mock_utcnow.return_value = 'fake-now'
         driver.volume_update_db(self.context, 31337, 'fake_host')
index 02b948956483fd93842bc15a869795845e0fec3c..8e30649e3d06ec5e6a212e0764564af7131e9884 100644 (file)
@@ -21,14 +21,14 @@ import tempfile
 
 import mock
 from oslo.config import cfg
+from oslo.utils import importutils
+from oslo.utils import timeutils
 
 from cinder.backup import manager
 from cinder import context
 from cinder import db
 from cinder import exception
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import test
 from cinder.tests.backup.fake_service_with_verify import\
     get_backup_driver
index bc528e1c9869f8fcea645e9d913ea7342042da8e..b062cf782ba057a263dad95354ae79b8ef67623f 100644 (file)
@@ -20,12 +20,12 @@ import mock
 import mox
 from oslo.config import cfg
 from oslo.serialization import jsonutils
+from oslo.utils import units
 
 from cinder.brick.initiator import connector
 from cinder import exception
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import test
 from cinder import utils
 from cinder.volume import configuration as conf
index f517679acd7a81c9cf320b1fcc412d48a64e98cb..4743f3f9250e271d336061339a9b483ba8ebc621 100644 (file)
@@ -14,9 +14,9 @@
 
 
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import context
-from cinder.openstack.common import importutils
 from cinder import test
 
 
index 373d6d9aa6fc1cfb098769ebe446d1ab253173ee..1455f991f24f546a77f05d610f35fc2fd61c3c83 100644 (file)
@@ -17,14 +17,14 @@ import copy
 import json
 
 import mock
+from oslo.utils import timeutils
+from oslo.utils import units
 import requests
 
 from cinder import context
 from cinder.db.sqlalchemy.models import VolumeMetadata
 from cinder import exception
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.fusionio.ioControl import FIOconnection
index d771a93a110d45c413c1b9abc2d0ed9ed2311504..e839255c8cb6c38a6b85a547f0a45634bbfc21ce 100644 (file)
@@ -27,6 +27,7 @@ from mox import IgnoreArg
 from mox import IsA
 from mox import stubout
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import brick
 from cinder import compute
@@ -37,7 +38,6 @@ from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import imageutils
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import units
 from cinder import test
 from cinder import utils
 from cinder.volume import configuration as conf
index cc59139dbc5397526a19be40dea1b6e3111c7f38..9fd1f6abbda63140bf51e0732055d4dd1455af88 100644 (file)
@@ -19,13 +19,13 @@ import tempfile
 
 import mock
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder import utils
 from cinder.volume import configuration as conf
index 26f9526f08531905132a901b05750381ba3b8f6c..ed2f9048956ced19f6f840d2243d6aecee84f2d5 100644 (file)
@@ -20,11 +20,11 @@ import mock
 import ast
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import test
 from cinder.tests import fake_hp_3par_client as hp3parclient
 from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon
index e0ec9e89d2665c9526c6a294a817c5d41a769978..0e3010d7be7e41374474bac910f0f5e94cdec0e4 100644 (file)
 #
 """Unit tests for OpenStack Cinder volume drivers."""
 import mock
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import test
 from cinder.tests import fake_hp_lefthand_client as hplefthandclient
 from cinder.volume.drivers.san.hp import hp_lefthand_iscsi
index fb1e8845f9b917432336b8ded08ad0d96e68abfe..11b294f42dfc3d50d1d50ee8cb0bc3bbd7037c6b 100644 (file)
@@ -23,11 +23,11 @@ NAS based IBM GPFS Storage Systems).
 
 import mock
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.ibm import ibmnas
index 4d54559aebb4b0076f94a45dbb3390d02c2919f5..025a12a6c611d126bd1cb62399b20eabf24cdceb 100644 (file)
@@ -21,13 +21,13 @@ import tempfile
 import mock
 import mox
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder import utils
 from cinder.volume import utils as volume_utils
index b4468454cf8bf706680daa78c49079280451ec0f..0192db102260b2c834bee8c7d5ad483b6c911296 100644 (file)
@@ -21,10 +21,10 @@ import base64
 import urllib2
 
 import mox as mox_lib
+from oslo.utils import units
 
 from cinder import context
 from cinder import db
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers import nexenta
index 9031e3ea7d46aee7db5e4277811107dc05e9b0df..c7a72645fbc6ca3d6a78d7c08f0e0fcb7eb20ccd 100644 (file)
@@ -22,11 +22,11 @@ import mox as mox_lib
 from mox import IgnoreArg
 from mox import IsA
 from mox import stubout
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.image import image_utils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers import nfs
index c390af722e543355de8db105fac8eb57768d2b1a..901320100e16e200b56bab31e3c012e676a02ece 100644 (file)
@@ -17,9 +17,9 @@ import httplib
 import re
 
 import mock
+from oslo.utils import units
 
 from cinder import exception
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.prophetstor import dpl_iscsi as DPLDRIVER
index 27f36b5a10e2fc66115facf5d57526ec4bd5eafa..15ef87f219aa361dace05953cc88aa2a680aad3f 100644 (file)
@@ -17,10 +17,10 @@ import json
 import urllib2
 
 import mock
+from oslo.utils import units
 
 from cinder import exception
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume.drivers import pure
 
index 94d40371073cd76dc0d6e329dce259f5c9c36cb6..aed9dd15481f70b4e3d7ce81aef4e0362e055d20 100644 (file)
@@ -20,6 +20,7 @@ import datetime
 
 import mock
 from oslo.config import cfg
+from oslo.utils import timeutils
 
 from cinder import backup
 from cinder import context
@@ -27,7 +28,6 @@ from cinder import db
 from cinder.db.sqlalchemy import api as sqa_api
 from cinder.db.sqlalchemy import models as sqa_models
 from cinder import exception
-from cinder.openstack.common import timeutils
 from cinder import quota
 from cinder import test
 import cinder.tests.image.fake
index 99cdfd72415c091c43253a7a4df154b830817417..d3ac8198dca95777929b0235a1dedf3a0743b43c 100644 (file)
@@ -21,14 +21,14 @@ import os
 import tempfile
 
 import mock
+from oslo.utils import timeutils
+from oslo.utils import units
 
 from cinder import db
 from cinder import exception
 from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.tests.image import fake as fake_image
 from cinder.tests.test_volume import DriverTestCase
index 5ccec65fc7b15b934e117855f1828899604cf3ed..8da2ad400fcf8a55d10f08bf93ab2bb5f198c468 100644 (file)
@@ -17,11 +17,11 @@ Tests for Volume replication code.
 
 import mock
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import context
 from cinder import db
 from cinder import exception
-from cinder.openstack.common import importutils
 from cinder import test
 from cinder.tests import utils as test_utils
 
index d46cb43f74508f7a00fcbe75d0acc9a197d1f9fc..b001856214009eeedbb27a1fff8f0066a86d1df3 100644 (file)
@@ -22,11 +22,11 @@ import shutil
 import tempfile
 
 import mox as mox_lib
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.image import image_utils
-from cinder.openstack.common import units
 from cinder import test
 from cinder import utils
 from cinder.volume import configuration as conf
index d19aad63de2f3e7e63676f1a3fa82d4c884db12f..fe298fe6c59a4437b7e288dc83252655ee397ba5 100644 (file)
@@ -19,9 +19,10 @@ import contextlib
 import os
 import tempfile
 
+from oslo.utils import units
+
 from cinder.image import image_utils
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume.drivers.sheepdog import SheepdogDriver
 
index 36d85220928c957447b64d2c30ea01cdefdcb906..1a37be387e9fa111d7d4c86f36e11ead4c627f02 100644 (file)
 #    under the License.
 
 import mox
+from oslo.utils import timeutils
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.solidfire import SolidFireDriver
index d75396ea72f1898f380128ad46e157183de60584..8c6bfb023d7809357df53294bb2b226ccdd1a060 100644 (file)
@@ -23,15 +23,15 @@ import re
 import time
 
 import mock
+from oslo.utils import excutils
+from oslo.utils import importutils
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import test
 from cinder.tests import utils as testutils
 from cinder import utils
index 70437a24e2ea4b654de7fa8b94823ccab97ef8f0..7f0f7912ef7104dde6ebf7a7c18cce709d0a2f83 100644 (file)
@@ -22,6 +22,7 @@ import uuid
 
 import mock
 from oslo.config import cfg
+from oslo.utils import timeutils
 import paramiko
 import six
 
@@ -30,7 +31,6 @@ from cinder.brick.initiator import connector
 from cinder.brick.initiator import linuxfc
 from cinder import exception
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import timeutils
 from cinder import ssh_utils
 from cinder import test
 from cinder import utils
@@ -390,7 +390,7 @@ class GenericUtilsTestCase(test.TestCase):
                 self.assertEqual(fake_execute.uid, 2)
             self.assertEqual(fake_execute.uid, os.getuid())
 
-    @mock.patch('cinder.openstack.common.timeutils.utcnow')
+    @mock.patch('oslo.utils.timeutils.utcnow')
     def test_service_is_up(self, mock_utcnow):
         fts_func = datetime.datetime.fromtimestamp
         fake_now = 1000
index 3b6409ac263c54fe6f3e79ecff16f9637d0d1f9d..e5206369ffd92508bf0d9539082c7da552b7126c 100644 (file)
@@ -18,8 +18,8 @@ Unit tests for datastore module.
 """
 
 import mock
+from oslo.utils import units
 
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume.drivers.vmware import datastore as ds_sel
 from cinder.volume.drivers.vmware import error_util
index 82da1a0c31b13806f927330de86b77710bc581ef..418461800f3d4121fbf8fa2d10e2664327977c33 100644 (file)
@@ -22,10 +22,10 @@ import os
 
 import mock
 import mox
+from oslo.utils import units
 
 from cinder import exception
 from cinder.image import glance
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration
 from cinder.volume.drivers.vmware import api
index 3aef159ac4c5ec636abe498281468362ba75dc40..8527217cd84942b2accdd00b90b84ff5c33cb25e 100644 (file)
@@ -18,8 +18,8 @@ Test suite for VMware VMDK driver volumeops module.
 """
 
 import mock
+from oslo.utils import units
 
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume.drivers.vmware import error_util
 from cinder.volume.drivers.vmware import vim_util
index 32628dbb61c273b201ac327df76de304db4aa601..11e9c25e797d602e9d7b2d5e8d3cacdfbe646b82 100644 (file)
@@ -31,6 +31,9 @@ import mock
 import mox
 from oslo.config import cfg
 from oslo.serialization import jsonutils
+from oslo.utils import importutils
+from oslo.utils import timeutils
+from oslo.utils import units
 from stevedore import extension
 from taskflow.engines.action_engine import engine
 
@@ -43,10 +46,7 @@ from cinder import exception
 from cinder.image import image_utils
 from cinder import keymgr
 from cinder.openstack.common import fileutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 import cinder.policy
 from cinder import quota
 from cinder import test
index 04d0fc58f39b3aace0920990c1aa48fcf28be390..3916692fa98a4b5ac37db7c1a635839ac97a2603 100644 (file)
@@ -20,11 +20,11 @@ import re
 
 import mock
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import context
 from cinder import db
 from cinder import exception
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import test
index dd555d827eb0e57c1ee849d18d06287b575c2703..a09e00b0602f6e940f873e1bb8b5ce524d27ffa2 100644 (file)
@@ -19,8 +19,9 @@ import mock
 
 from json import JSONEncoder
 
+from oslo.utils import units
+
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import test
 from cinder.volume import configuration as conf
 from cinder.volume.drivers.zfssa import restclient as client
index f3cec3a4d44f6fb5193471eb22800ef22cd278e5..ab5133ef52cb0f99c1d61988e7a885cbb08ae4a4 100644 (file)
 
 import mock
 from oslo.config import cfg
+from oslo.utils import importutils
 import paramiko
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder import test
 from cinder.volume import configuration as conf
index 7083e86bce1859c535f4453b44fcb7972eb53992..f0cbb9fc16dc3d22ee5e4afb6b83d63a0c435669 100644 (file)
@@ -18,9 +18,9 @@
 """Unit tests for Cisco FC zone driver."""
 
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import exception
-from cinder.openstack.common import importutils
 from cinder.openstack.common import processutils
 from cinder import test
 from cinder.volume import configuration as conf
index 7a4f44547b246c60b32d12d515bc18d74773ed72..7b972ac4e05bfe4568fe12b56e2842482677055e 100644 (file)
 
 
 from oslo.config import cfg
-
-import cinder.openstack.common.importutils
+from oslo.utils import importutils
 
 
 CONF = cfg.CONF
 
-API = cinder.openstack.common.importutils.import_class(CONF.transfer_api_class)
+API = importutils.import_class(CONF.transfer_api_class)
index 6f98101620f457e25b649d516156b5f656a89c20..7065f3312d2d0e57159e0a71fcea034b9a0d15f7 100644 (file)
@@ -23,11 +23,11 @@ import hmac
 import os
 
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder.db import base
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import quota
 from cinder.volume import api as volume_api
index 8f27701c556da461c4df1292eda5505b4960f92c..ba27646b9df416549daeb9369499580d0ef600e2 100644 (file)
@@ -36,16 +36,16 @@ from xml.sax import expatreader
 from xml.sax import saxutils
 
 from oslo.config import cfg
+from oslo.utils import importutils
+from oslo.utils import timeutils
 import six
 
 from cinder.brick.initiator import connector
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import timeutils
 
 
 CONF = cfg.CONF
index e845ea618e98b16d0eb0d5e55f9805a9acabdfb1..374aa8851c8601eb47cf38a15e6fc9e173cfde34 100644 (file)
 # Importing full names to not pollute the namespace and cause possible
 # collisions with use of 'from cinder.volume import <foo>' elsewhere.
 
+from oslo.utils import importutils
 
 from cinder.common import config
-import cinder.openstack.common.importutils as import_utils
 
 
 CONF = config.CONF
 
-API = import_utils.import_class(CONF.volume_api_class)
+API = importutils.import_class(CONF.volume_api_class)
index 57c79a36710430307a9a3e464dc4684127079906..43618de17efc48bab23ba365a89765c143a609ce 100644 (file)
@@ -24,6 +24,8 @@ import datetime
 import functools
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import timeutils
 import six
 
 from cinder import context
@@ -33,9 +35,7 @@ from cinder import flow_utils
 from cinder.i18n import _
 from cinder.image import glance
 from cinder import keymgr
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder.openstack.common import uuidutils
 import cinder.policy
 from cinder import quota
index 6eba5d83f074d71c6d3607806e9965d7353e7cd7..c02231e706c84194e2892bf179e17185ab4743df 100644 (file)
@@ -20,11 +20,11 @@ Drivers for volumes.
 import time
 
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _, _LE
 from cinder.image import image_utils
-from cinder.openstack.common import excutils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
index 4bafa7a1507e859735df8bd9857c8791040b6483..ab48789e17c252a4a8bb48c3722b649f3f42e06f 100644 (file)
@@ -28,13 +28,13 @@ import urllib2
 
 from oslo.config import cfg
 from oslo.serialization import jsonutils
+from oslo.utils import units
 import six.moves.urllib.parse as urlparse
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume import driver
 from cinder.volume import volume_types
 
index 6c28072b2bbe01b205ff25022fb9a40f541021ba..65ae3bdb15d809a1c537efa0ff4e92e1a9660872 100644 (file)
 import json
 
 from oslo.config import cfg
+from oslo.utils import units
 import requests
 
 from cinder import exception
 from cinder.i18n import _, _LE
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume.drivers.san import san
 
 LOG = logging.getLogger(__name__)
index 70810c7cd1b7e2795d90cfcefbd5bfe0cff47c76..eeee3877fad40441a6e50b2a7b832dbd0062bb4d 100644 (file)
@@ -23,17 +23,17 @@ import time
 
 from oslo.config import cfg
 from oslo.serialization import jsonutils as json
+from oslo.utils import excutils
+from oslo.utils import timeutils
 import six
 
 from cinder import exception
 from cinder.exception import EMCVnxCLICmdError
 from cinder.i18n import _, _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
 from cinder.openstack.common import processutils
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder.volume.configuration import Configuration
 from cinder.volume.drivers.san import san
index 94be9d68c5f61b0d428c02b4e3f92c090d746e55..82e91c46b3dc18d8711deeae5445104e7ae9fb82 100644 (file)
@@ -22,10 +22,10 @@ import eventlet
 from eventlet import greenthread
 import greenlet
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LW, _LI
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import ssh_utils
index 53495f364a87b6464c3de6b1a227f8777e1ebca7..795b944ef87abb44518c1a5febf032898b96286e 100644 (file)
@@ -26,13 +26,13 @@ import time
 from xml.dom.minidom import parseString
 
 from oslo.config import cfg
+from oslo.utils import units
 import six
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LW
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import units
 from cinder.volume import volume_types
 
 LOG = logging.getLogger(__name__)
index b1709da45bcd47a3ec84e29ea9012280f6a664ec..e3b09856bacc25dc5ae1b8583668a4ca99dc443f 100644 (file)
@@ -24,13 +24,13 @@ import random
 import uuid
 
 from oslo.config import cfg
+from oslo.utils import units
 import requests
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import units
 from cinder.volume.drivers.san.san import SanISCSIDriver
 from cinder.volume import qos_specs
 from cinder.volume import volume_types
index 9e98c1af46a3d6c174fde76a611da675907684ec..0661c054c0ca3f954ef10d28c4f15304c0de73da 100644 (file)
@@ -19,6 +19,7 @@ import stat
 import time
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder.brick.remotefs import remotefs as remotefs_brick
 from cinder import compute
@@ -29,7 +30,6 @@ from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers import remotefs as remotefs_drv
 
index 9c9bca2666f97b75431f88923f48f86f1c8ff32f..7fe55734511472cb709ae6f76c18a331ab1cbf9c 100644 (file)
@@ -22,10 +22,10 @@ iSCSI Cinder Volume driver for Hitachi Unified Storage (HUS) platform.
 from xml.etree import ElementTree as ETree
 
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import utils
 from cinder.volume import driver
index 10b9a103452ec6716e3126a34f9cea97359804db..420affa64a2d71b2b81ec8c67a42adfcc2b8307e 100644 (file)
@@ -20,8 +20,9 @@ Hitachi Unified Storage (HUS-HNAS) platform. Backend operations.
 
 import re
 
+from oslo.utils import units
+
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import utils
 
 LOG = logging.getLogger("cinder.volume.driver")
index b89ad6201745758985ff72dea9b1a0ebc63d6662..fcb71eed708b4115d955f1f3c3875dd89ab5276f 100644 (file)
@@ -21,12 +21,12 @@ iSCSI Cinder Volume driver for Hitachi Unified Storage (HUS-HNAS) platform.
 from xml.etree import ElementTree as ETree
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _LE, _LI
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume import driver
 from cinder.volume.drivers.hds.hnas_backend import HnasBackend
 from cinder.volume import utils
index 66b408837f21a22d524682e7f18dbc10e353c9e0..a4694f802a86ecaad79be1d7a58ceb4882e94233 100644 (file)
@@ -22,14 +22,14 @@ import time
 from xml.etree import ElementTree as ETree
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
 from cinder.image import image_utils
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder.volume.drivers.hds.hnas_backend import HnasBackend
 from cinder.volume.drivers import nfs
 
index 74c5782b62089521f434a586e401c411db616ea1..3390295f21228d9f8ba607acde50aae6036ca305 100644 (file)
@@ -16,11 +16,11 @@ import inspect
 import os
 import shlex
 
+from oslo.utils import excutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
index cf1e5d50bb1ac4190bfd8dd62f94bab4ae2d97f5..6739dc1d54f33aa3775338fd9490b14c2745ca88 100644 (file)
@@ -21,13 +21,13 @@ import re
 import threading
 
 from oslo.config import cfg
+from oslo.utils import excutils
 import six
 
 from cinder.db.sqlalchemy import api
 from cinder.db.sqlalchemy import models
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import utils
 from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib
index c461e0f520c3be6fc0ea6473bfed8295c5cef3b6..8fb2269b96a12f05e293fdafbf29f39b6d50b2a1 100644 (file)
@@ -21,11 +21,11 @@ import os
 import threading
 
 from oslo.config import cfg
+from oslo.utils import excutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import utils
 import cinder.volume.driver
index 58ff10f1cefe0ac4612c181ee5889a8533a1f770..34bd88bd9486141dc3b6d90c58440c8a692a709d 100644 (file)
@@ -21,11 +21,11 @@ import threading
 import time
 
 from oslo.config import cfg
+from oslo.utils import excutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
 from cinder.openstack.common import processutils as putils
index fca545d504d2eb40fcc1514c11603ad10dfc3229..d7e56f83d926aa4e5a54111ed54716dfcde2502d 100644 (file)
@@ -23,12 +23,13 @@ import urllib2
 import uuid
 from xml.etree import ElementTree as ET
 
+from oslo.utils import excutils
+from oslo.utils import units
+
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers.huawei import huawei_utils
 from cinder.volume import volume_types
index 8706811c5dd71f798b2d8df88273aa67530bf05c..0cf026f9600a1ae02193153358220cd154841fe8 100644 (file)
@@ -26,10 +26,11 @@ import threading
 import time
 from xml.etree import ElementTree as ET
 
+from oslo.utils import excutils
+
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import ssh_utils
 from cinder import utils
index e12ee4bb1e695f7abb94756ec0a9b182faec5f22..923458b56706f1f91c5091ed9ee63d5a9ea03da2 100644 (file)
@@ -22,6 +22,7 @@ import re
 import shutil
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
@@ -29,7 +30,6 @@ from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume import driver
 
index 102d8e7f3aebe10488f520ca2ec1b14ca7e9ab23..294af38cbc38f9032347cd83a2e8a67f4255da52 100644 (file)
@@ -33,13 +33,13 @@ import os
 import re
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _, _LI, _LW
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers import nfs
 from cinder.volume.drivers.remotefs import nas_opts
index 62d2c7d59c8847ff5963f364ea7dfca591e4c629..7adbf4f63f337f922901e47fa0e4c6ab17bcc59b 100644 (file)
@@ -38,14 +38,14 @@ import math
 import time
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers.ibm.storwize_svc import helpers as storwize_helpers
 from cinder.volume.drivers.ibm.storwize_svc import replication as storwize_rep
index 23248a5099f3b76e52793a6b855d2de82eed1fce..872ddc8392820f8879974d83c8e61fdd8a099317 100644 (file)
@@ -19,15 +19,15 @@ import re
 import unicodedata
 
 from eventlet import greenthread
+from oslo.utils import excutils
+from oslo.utils import strutils
 import six
 
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import strutils
 from cinder.volume.drivers.ibm.storwize_svc import ssh as storwize_ssh
 from cinder.volume import qos_specs
 from cinder.volume import utils
index 0dbfdf0394df24b848c1c4a5ac09a99bb1162c2a..9a32b92bd5b9d451c56c6e0efd5c2ad81d1e3285 100644 (file)
@@ -23,9 +23,9 @@ Unified Volume driver for IBM XIV and DS8K Storage Systems.
 """
 
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import exception
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.volume.drivers.san import san
 
index a51b1e7323e81000531835121f4324cecfee9ee9..a4035f81bcb809e68021dfacc80f48f1ea7db8e4 100644 (file)
@@ -23,6 +23,7 @@ import os
 import socket
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder.brick import exception as brick_exception
 from cinder.brick.local_dev import lvm as lvm
@@ -32,7 +33,6 @@ from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume import driver
 from cinder.volume import utils as volutils
index e3f9e8c1442e37c1b356077edac570531640b816..d6acd0640d048efdfbca91316772d173bbe1cb72 100644 (file)
@@ -18,10 +18,10 @@ Unified driver for NetApp storage systems.
 
 Supports call to multiple storage systems of different families and protocols.
 """
+from oslo.utils import importutils
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.volume import driver
 from cinder.volume.drivers.netapp.options import netapp_proxy_opts
index 1ef84cc3586f975111042e9b2af2064e2c83fdda..b80384a94f9a46bca61f7c56f29721cb70e0429f 100644 (file)
@@ -21,13 +21,13 @@ import time
 import uuid
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 import six
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import utils as cinder_utils
 from cinder.volume import driver
 from cinder.volume.drivers.netapp.eseries import client
index b479a30e6cf8132d4ecc47f40b0329331154f8d6..dccac08ca27dba7f0d99f4ecb25f454001afc761 100644 (file)
@@ -26,14 +26,14 @@ import sys
 import time
 import uuid
 
+from oslo.utils import excutils
+from oslo.utils import timeutils
+from oslo.utils import units
 import six
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume import driver
 from cinder.volume.drivers.netapp.api import NaApiError
index 35b8db94f4de098530530f2562805429556e839c..288a270059ed24e4954d29f8ef73acca5924f21f 100644 (file)
@@ -23,16 +23,16 @@ from threading import Timer
 import time
 import uuid
 
+from oslo.utils import excutils
+from oslo.utils import units
 import six
 import six.moves.urllib.parse as urlparse
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
 from cinder.image import image_utils
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers.netapp.api import NaApiError
 from cinder.volume.drivers.netapp.api import NaElement
index a318b10768ebac85a2e980b48b0c15b4aaa60aef..2c22ef6cfa5c9700fedad3eba531427afc2de1f2 100644 (file)
@@ -20,12 +20,12 @@ Storage service catalog utility functions and classes for NetApp systems.
 import copy
 from threading import Timer
 
+from oslo.utils import timeutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder.volume import driver
 from cinder.volume.drivers.netapp import api
index 85d24ca00e61d848f441fd5664fd4f27b7bd2331..a4fd34afd98eec6dcd3b59a08f27e4d3af82feb7 100644 (file)
@@ -28,6 +28,7 @@ import platform
 import socket
 import uuid
 
+from oslo.utils import timeutils
 import six
 
 from cinder import context
@@ -35,7 +36,6 @@ from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder import version
 from cinder.volume.drivers.netapp.api import NaApiError
index d3eee00e644adc056ebe9f7ac94f9b199ed1ca98..84e6976aa74e4d070505e60be062e38582171e6a 100644 (file)
@@ -25,12 +25,13 @@ import hashlib
 import os
 import re
 
+from oslo.utils import units
+
 from cinder import context
 from cinder import db
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume.drivers import nexenta
 from cinder.volume.drivers.nexenta import jsonrpc
 from cinder.volume.drivers.nexenta import options
index 55f040970fd37162bfeff24214cc17cd90853631..a7c3f12c1c42ace33d196f1da324736a7f3e7d6d 100644 (file)
 
 import re
 
+from oslo.utils import units
 import six.moves.urllib.parse as urlparse
 
 from cinder.i18n import _
-from cinder.openstack.common import units
 
 
 def str2size(s, scale=1024):
index d2aef63cc2080929c2ef0d69d7d834d55139b4c9..e671e979851c06443a008bdf006bfd80a59fa655 100644 (file)
@@ -17,6 +17,7 @@ import errno
 import os
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder.brick.remotefs import remotefs as remotefs_brick
 from cinder import exception
@@ -24,7 +25,6 @@ from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers import remotefs
 
index 8b497ad8387b2b54ab877bd538ccb332ebe68579..76a74aad6626cc3786eb83a72306d298f22e0c7f 100644 (file)
@@ -25,12 +25,12 @@ import string
 import urllib2
 
 from oslo.config import cfg
+from oslo.utils import units
 from suds import client
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume.drivers.san.san import SanISCSIDriver
 
 
index 5b7995e25b3f1168b61b10546583dc72fc55f4df..669c1ba16cd51f089940b57e489f5787dc226740 100644 (file)
@@ -24,13 +24,13 @@ import json
 import random
 import time
 
+from oslo.utils import units
 import six
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import units
 from cinder.volume import driver
 from cinder.volume.drivers.prophetstor import options
 from cinder.volume.drivers.san import san
index 683634b2ecc28b61af812dc61159e521b80b573d..91334975e138863f9ac2f197dec17bf630679cbf 100644 (file)
@@ -25,13 +25,13 @@ import urllib2
 import uuid
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _LE, _LI, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers.san import san
 
index be23b7ebd760d312fd9a450f13b0a979feb3aeaf..2ccbb0e3525b605673dc98b3104f84ad248ea724 100644 (file)
@@ -22,6 +22,8 @@ import tempfile
 import urllib
 
 from oslo.config import cfg
+from oslo.utils import encodeutils
+from oslo.utils import units
 import six
 
 from cinder import exception
@@ -29,8 +31,6 @@ from cinder.i18n import _, _LE, _LI, _LW
 from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import strutils
-from cinder.openstack.common import units
 from cinder.volume import driver
 
 try:
@@ -89,9 +89,9 @@ class RBDImageMetadata(object):
     """RBD image metadata to be used with RBDImageIOWrapper."""
     def __init__(self, image, pool, user, conf):
         self.image = image
-        self.pool = strutils.safe_encode(pool)
-        self.user = strutils.safe_encode(user)
-        self.conf = strutils.safe_encode(conf)
+        self.pool = encodeutils.safe_encode(pool)
+        self.user = encodeutils.safe_encode(user)
+        self.conf = encodeutils.safe_encode(conf)
 
 
 class RBDImageIOWrapper(io.RawIOBase):
@@ -206,10 +206,11 @@ class RBDVolumeProxy(object):
                  read_only=False):
         client, ioctx = driver._connect_to_rados(pool)
         if snapshot is not None:
-            snapshot = strutils.safe_encode(snapshot)
+            snapshot = encodeutils.safe_encode(snapshot)
 
         try:
-            self.volume = driver.rbd.Image(ioctx, strutils.safe_encode(name),
+            self.volume = driver.rbd.Image(ioctx,
+                                           encodeutils.safe_encode(name),
                                            snapshot=snapshot,
                                            read_only=read_only)
         except driver.rbd.Error:
@@ -264,7 +265,7 @@ class RBDDriver(driver.VolumeDriver):
         for attr in ['rbd_user', 'rbd_ceph_conf', 'rbd_pool']:
             val = getattr(self.configuration, attr)
             if val is not None:
-                setattr(self.configuration, attr, strutils.safe_encode(val))
+                setattr(self.configuration, attr, encodeutils.safe_encode(val))
 
     def check_for_setup_error(self):
         """Returns an error if prerequisites aren't met."""
@@ -294,7 +295,7 @@ class RBDDriver(driver.VolumeDriver):
         client = self.rados.Rados(rados_id=self.configuration.rbd_user,
                                   conffile=self.configuration.rbd_ceph_conf)
         if pool is not None:
-            pool = strutils.safe_encode(pool)
+            pool = encodeutils.safe_encode(pool)
         else:
             pool = self.configuration.rbd_pool
 
@@ -414,8 +415,8 @@ class RBDDriver(driver.VolumeDriver):
         and that clone has rbd_max_clone_depth clones behind it, the source
         volume will be flattened.
         """
-        src_name = strutils.safe_encode(src_vref['name'])
-        dest_name = strutils.safe_encode(volume['name'])
+        src_name = encodeutils.safe_encode(src_vref['name'])
+        dest_name = encodeutils.safe_encode(volume['name'])
         flatten_parent = False
 
         # Do full copy if requested
@@ -501,7 +502,7 @@ class RBDDriver(driver.VolumeDriver):
 
         with RADOSClient(self) as client:
             self.rbd.RBD().create(client.ioctx,
-                                  strutils.safe_encode(volume['name']),
+                                  encodeutils.safe_encode(volume['name']),
                                   size,
                                   order,
                                   old_format=old_format,
@@ -520,10 +521,10 @@ class RBDDriver(driver.VolumeDriver):
         with RADOSClient(self, src_pool) as src_client:
             with RADOSClient(self) as dest_client:
                 self.rbd.RBD().clone(src_client.ioctx,
-                                     strutils.safe_encode(src_image),
-                                     strutils.safe_encode(src_snap),
+                                     encodeutils.safe_encode(src_image),
+                                     encodeutils.safe_encode(src_snap),
                                      dest_client.ioctx,
-                                     strutils.safe_encode(volume['name']),
+                                     encodeutils.safe_encode(volume['name']),
                                      features=self.rbd.RBD_FEATURE_LAYERING)
 
     def _resize(self, volume, **kwargs):
@@ -610,7 +611,7 @@ class RBDDriver(driver.VolumeDriver):
         """Deletes a logical volume."""
         # NOTE(dosaboy): this was broken by commit cbe1d5f. Ensure names are
         #                utf-8 otherwise librbd will barf.
-        volume_name = strutils.safe_encode(volume['name'])
+        volume_name = encodeutils.safe_encode(volume['name'])
         with RADOSClient(self) as client:
             try:
                 rbd_image = self.rbd.Image(client.ioctx, volume_name)
@@ -676,7 +677,7 @@ class RBDDriver(driver.VolumeDriver):
     def create_snapshot(self, snapshot):
         """Creates an rbd snapshot."""
         with RBDVolumeProxy(self, snapshot['volume_name']) as volume:
-            snap = strutils.safe_encode(snapshot['name'])
+            snap = encodeutils.safe_encode(snapshot['name'])
             volume.create_snap(snap)
             if self._supports_layering():
                 volume.protect_snap(snap)
@@ -685,8 +686,8 @@ class RBDDriver(driver.VolumeDriver):
         """Deletes an rbd snapshot."""
         # NOTE(dosaboy): this was broken by commit cbe1d5f. Ensure names are
         #                utf-8 otherwise librbd will barf.
-        volume_name = strutils.safe_encode(snapshot['volume_name'])
-        snap_name = strutils.safe_encode(snapshot['name'])
+        volume_name = encodeutils.safe_encode(snapshot['volume_name'])
+        snap_name = encodeutils.safe_encode(snapshot['name'])
         with RBDVolumeProxy(self, volume_name) as volume:
             if self._supports_layering():
                 try:
@@ -890,8 +891,9 @@ class RBDDriver(driver.VolumeDriver):
         # Raise an exception if we didn't find a suitable rbd image.
         with RADOSClient(self) as client:
             rbd_name = existing_ref['source-name']
-            self.rbd.RBD().rename(client.ioctx, strutils.safe_encode(rbd_name),
-                                  strutils.safe_encode(volume['name']))
+            self.rbd.RBD().rename(client.ioctx,
+                                  encodeutils.safe_encode(rbd_name),
+                                  encodeutils.safe_encode(volume['name']))
 
     def manage_existing_get_size(self, volume, existing_ref):
         """Return size of an existing image for manage_existing.
@@ -909,7 +911,7 @@ class RBDDriver(driver.VolumeDriver):
             raise exception.ManageExistingInvalidReference(
                 existing_ref=existing_ref, reason=reason)
 
-        rbd_name = strutils.safe_encode(existing_ref['source-name'])
+        rbd_name = encodeutils.safe_encode(existing_ref['source-name'])
 
         with RADOSClient(self) as client:
             # Raise an exception if we didn't find a suitable rbd image.
index 4c1850d8ac192eb3469a406072bc42edb39d6f08..6cc809b95804498fe1d86b5179ea705244926363 100644 (file)
@@ -21,13 +21,13 @@ import re
 import tempfile
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI, _LW
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import units
 from cinder.volume import driver
 
 LOG = logging.getLogger(__name__)
index b780842b7dad6d8f6a4c2fd186f41bd7d574de07..ed15db9abf2f70e24cabf54e38b5dc4f329e161e 100644 (file)
@@ -42,24 +42,24 @@ import pprint
 import re
 import uuid
 
+from oslo.utils import importutils
 import six
 
-from cinder.openstack.common import importutils
 hp3parclient = importutils.try_import("hp3parclient")
 if hp3parclient:
     from hp3parclient import client
     from hp3parclient import exceptions as hpexceptions
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder import flow_utils
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import loopingcall
-from cinder.openstack.common import units
 from cinder.volume import qos_specs
 from cinder.volume import utils as volume_utils
 from cinder.volume import volume_types
index 420362a0eab0cb75d394ce0bb00201caaaf3f594..b334002495dd1c56a6583672a9f1c881d8c0e73f 100644 (file)
@@ -21,12 +21,12 @@ operations on the SAN.
 """
 
 from lxml import etree
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder.volume.drivers.san.san import SanISCSIDriver
 
 
index fb39aec99b0eb4d918e0dce5ad905a5e31de29fd..a916d40540650d6a53b9a082c155c680e0c5b0a5 100644 (file)
 """HP LeftHand SAN ISCSI REST Proxy."""
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import context
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume.driver import ISCSIDriver
 from cinder.volume import utils
 from cinder.volume import volume_types
index 81f66df30dea993b2302f624c343dfb33112508b..5637203d9537f0a4c49e6e0a43b418693f2ff1c0 100644 (file)
@@ -23,10 +23,10 @@ import random
 
 from eventlet import greenthread
 from oslo.config import cfg
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import ssh_utils
index c272dbd110092a1c3dd52c7858daaafe960d0fc6..282ac3a1b71e41b39f2137a8ec9d23165cf4940e 100644 (file)
@@ -22,13 +22,13 @@ import os
 import urllib2
 
 from oslo.config import cfg
+from oslo.utils import units
 import six.moves.urllib.parse as urlparse
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume import driver
 
 
index 85841c78953d02f228e7b2271e294489c7388fe3..0ee092efa928fb43ed2f06b0c229f9ae2f4d76cf 100644 (file)
@@ -23,13 +23,13 @@ import re
 import tempfile
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _, _LE
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import units
 from cinder.volume import driver
 
 
index d824e8127eed1ce503b07772b7d6f69595509ee0..a6863b3542023a7aa5a0b940dcba23a6d28eea20 100644 (file)
@@ -17,6 +17,7 @@ import os
 import re
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder.brick.remotefs import remotefs
 from cinder import exception
@@ -24,7 +25,6 @@ from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers import remotefs as remotefs_drv
 
index ff6cda16c5fde9b34d942a10dd851170842a2654..2684d27089ca2fe080e54027bcd38a14eed2079f 100644 (file)
@@ -20,6 +20,8 @@ import string
 import time
 
 from oslo.config import cfg
+from oslo.utils import timeutils
+from oslo.utils import units
 import requests
 from six import wraps
 
@@ -27,8 +29,6 @@ from cinder import context
 from cinder import exception
 from cinder.i18n import _, _LE, _LW
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder.volume.drivers.san.san import SanISCSIDriver
 from cinder.volume import qos_specs
 from cinder.volume import volume_types
index 9aab5af1726fd489f2f85c20793db7b4c8ea6cd0..f686596bd23a9cf724b2419940b51a95fa1d52b4 100644 (file)
@@ -17,8 +17,9 @@
 Classes and utility methods for datastore selection.
 """
 
+from oslo.utils import excutils
+
 from cinder.i18n import _LE, _LW
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.volume.drivers.vmware import error_util
 from cinder.volume.drivers.vmware import vim_util
index 50f92080cb5b112abd902f6ed33c9ff49339c3d7..28cfdf62df4d347dcc550babe1dc69d717a86072 100644 (file)
@@ -28,13 +28,13 @@ import os
 import tempfile
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.openstack.common import uuidutils
 from cinder.volume import driver
 from cinder.volume.drivers.vmware import api
index bae6fb6e312bf574d7378c1b9264b8e450da4d18..92bdf422eebf631d1298d975a9782dc77e817f0b 100644 (file)
@@ -19,9 +19,10 @@ Implements operations on volumes residing on VMware datastores.
 
 import urllib
 
+from oslo.utils import units
+
 from cinder.i18n import _, _LE, _LI
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder.volume.drivers.vmware import error_util
 from cinder.volume.drivers.vmware import vim_util
 
index c7e26eff447a4182cdff533f99e695d157376a7b..76fc2410a8320a40aacae714267046cd558a4b7f 100644 (file)
@@ -19,13 +19,13 @@ import re
 import sys
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.image import image_utils
 from cinder.openstack.common import fileutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import units
 from cinder import utils
 from cinder.volume.drivers import smbfs
 from cinder.volume.drivers.windows import remotefs
index f2c781fbe00844608ee48b01796c6e703b5cd9c8..1842c245f77486cb350f5c857ce810c9aa4642c0 100644 (file)
@@ -17,11 +17,11 @@ ZFS Storage Appliance Cinder Volume Driver
 import base64
 
 from oslo.config import cfg
+from oslo.utils import units
 
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log
-from cinder.openstack.common import units
 from cinder.volume import driver
 from cinder.volume.drivers.san import san
 from cinder.volume.drivers.zfssa import zfssarest
index f915bdc1b425d0f55f7099c2dca6d108e72dbbcc..5e054001c8f782d8ceb59fb73782e6bd448ba965 100644 (file)
@@ -12,6 +12,8 @@
 
 
 from oslo.config import cfg
+from oslo.utils import timeutils
+from oslo.utils import units
 import taskflow.engines
 from taskflow.patterns import linear_flow
 from taskflow.utils import misc
@@ -20,8 +22,6 @@ from cinder import exception
 from cinder import flow_utils
 from cinder.i18n import _, _LE
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import policy
 from cinder import quota
 from cinder import utils
index f26892a5958f37cb18a4517cf0c58c73abba5b2e..fd206816f85354181b159c67d8ac7a1deaf506de 100644 (file)
@@ -13,6 +13,7 @@
 import traceback
 
 from oslo.config import cfg
+from oslo.utils import timeutils
 import taskflow.engines
 from taskflow.patterns import linear_flow
 from taskflow.utils import misc
@@ -23,7 +24,6 @@ from cinder.i18n import _, _LE, _LI
 from cinder.image import glance
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import timeutils
 from cinder import utils
 from cinder.volume.flows import common
 from cinder.volume import utils as volume_utils
index eaa8bf4250fe8ef130f5ed688e3f140d643f90e5..b5a68b5b7ff69a07ac825502f17bc8c6c7e62cfb 100644 (file)
@@ -42,6 +42,9 @@ import time
 from oslo.config import cfg
 from oslo import messaging
 from oslo.serialization import jsonutils
+from oslo.utils import excutils
+from oslo.utils import importutils
+from oslo.utils import timeutils
 from osprofiler import profiler
 
 from cinder import compute
@@ -51,11 +54,8 @@ from cinder import flow_utils
 from cinder.i18n import _, _LE, _LI, _LW
 from cinder.image import glance
 from cinder import manager
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import periodic_task
-from cinder.openstack.common import timeutils
 from cinder.openstack.common import uuidutils
 from cinder import quota
 from cinder import utils
index 24ccf6141dc22ec071922a2a0314f782d79b42c7..61ae354ade2a5533792f8f7e800abdbacaa02415 100644 (file)
@@ -19,15 +19,15 @@ import math
 
 from Crypto.Random import random
 from oslo.config import cfg
+from oslo.utils import strutils
+from oslo.utils import timeutils
+from oslo.utils import units
 
 from cinder.brick.local_dev import lvm as brick_lvm
 from cinder import exception
 from cinder.i18n import _
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
-from cinder.openstack.common import strutils
-from cinder.openstack.common import timeutils
-from cinder.openstack.common import units
 from cinder import rpc
 from cinder import utils
 
index 7d09a2b3fc1d25984c260381e333a061f0b989e5..b575161826fe69198ad58b8144e266cd8eaf0006 100644 (file)
@@ -30,6 +30,8 @@ import eventlet
 import eventlet.wsgi
 import greenlet
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import netutils
 from paste import deploy
 import routes.middleware
 import webob.dec
@@ -37,9 +39,7 @@ import webob.exc
 
 from cinder import exception
 from cinder.i18n import _, _LE, _LI
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
-from cinder.openstack.common import network_utils
 from cinder import utils
 
 
@@ -208,11 +208,11 @@ class Server(object):
         # NOTE(praneshp): Call set_tcp_keepalive in oslo to set
         # tcp keepalive parameters. Sockets can hang around forever
         # without keepalive
-        network_utils.set_tcp_keepalive(dup_socket,
-                                        CONF.tcp_keepalive,
-                                        CONF.tcp_keepidle,
-                                        CONF.tcp_keepalive_count,
-                                        CONF.tcp_keepalive_interval)
+        netutils.set_tcp_keepalive(dup_socket,
+                                   CONF.tcp_keepalive,
+                                   CONF.tcp_keepidle,
+                                   CONF.tcp_keepalive_count,
+                                   CONF.tcp_keepalive_interval)
 
         if self._use_ssl:
             try:
index 8c64cb1784b67ce81cc5f5bcd54b48b866d526b9..7e00e0823f4957328aedf8f1dfcfed0d4c7b7872 100644 (file)
 
 
 from oslo.config import cfg
+from oslo.utils import excutils
 import paramiko
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder import utils
 from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
index d952de64969706efc6318db8ed661180f63514f7..e54a50cf72c73dd0c3afcb88a9b1a7e4a3dacafd 100644 (file)
@@ -25,10 +25,10 @@ import random
 import re
 
 from eventlet import greenthread
+from oslo.utils import excutils
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import ssh_utils
index 7e624b267a922bc984cde9d2b7e7d82172e5d9a5..96b1629952fca1c6fe7d3f7f6b5eeddc5cc650c4 100644 (file)
@@ -31,11 +31,11 @@ add_connection and delete_connection interfaces.
 
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import importutils
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
 from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
index a72bc9f9f95d5bc416106b3118db10911d108327..659157a8bbae7519633e0906bf9bca5bb0eea6fa 100644 (file)
 import random
 
 from eventlet import greenthread
+from oslo.utils import excutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import ssh_utils
index 7980708fdfbe123fa8025dd29f80d7d949d2cb3d..8f010dad7d2d39c2a0ab3bcb989f2e40a84fb272 100644 (file)
@@ -22,11 +22,11 @@ import random
 import re
 
 from eventlet import greenthread
+from oslo.utils import excutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils
 from cinder import ssh_utils
index 73c066549e01d7ec3d05d9611a71c99831ac9910..15fe0d837bdf52199633593eceb20eddb9fce580 100644 (file)
@@ -28,12 +28,12 @@ add_connection and delete_connection interfaces.
 """
 
 from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import importutils
 import six
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import excutils
-from cinder.openstack.common import importutils
 from cinder.openstack.common import lockutils
 from cinder.openstack.common import log as logging
 from cinder.zonemanager.drivers.cisco import cisco_fabric_opts as fabric_opts
index dd338d3ece200117940390fed497ffd2a5778d7a..1cbee7cf89a8ea7cdc0a8be17e3e2bb167f467a3 100644 (file)
@@ -23,9 +23,10 @@ defined in this class.
 
 """
 
+from oslo.utils import importutils
+
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.volume import configuration as config
 from cinder.zonemanager import fc_common
index e224972efd9a86f048a8dfb41349496c0d911bcf..42868da6edf753f8576ab635a320d789ad99e8f8 100644 (file)
@@ -32,10 +32,10 @@ detach operation.
 """
 
 from oslo.config import cfg
+from oslo.utils import importutils
 
 from cinder import exception
 from cinder.i18n import _
-from cinder.openstack.common import importutils
 from cinder.openstack.common import log as logging
 from cinder.volume import configuration as config
 from cinder.zonemanager import fc_common
index 663a642e7ecf30eeeb1ca2bf45a6cf897507a652..6152d233ac133f4f4d51b875ffe0a64819ea5a95 100644 (file)
@@ -7,7 +7,6 @@ module=excutils
 module=fileutils
 module=gettextutils
 module=imageutils
-module=importutils
 module=install_venv_common
 module=jsonutils
 module=local
@@ -16,7 +15,6 @@ module=log
 module=log_handler
 module=loopingcall
 module=middleware
-module=network_utils
 module=periodic_task
 module=policy
 module=processutils
@@ -27,7 +25,6 @@ module=scheduler.weights
 module=service
 module=strutils
 module=timeutils
-module=units
 module=uuidutils
 module=versionutils
 
index 9507c57a484f58ea605061264a1c24dee7f4255d..8d5e8676acfbc81fa4b68781b54f33fdd7c3b50f 100644 (file)
@@ -18,6 +18,7 @@ oslo.db>=1.0.0  # Apache-2.0
 oslo.messaging>=1.4.0
 oslo.rootwrap>=1.3.0
 oslo.serialization>=1.0.0               # Apache-2.0
+oslo.utils>=1.0.0                       # Apache-2.0
 osprofiler>=0.3.0                       # Apache-2.0
 paramiko>=1.13.0
 Paste