# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import strutils
import webob
from webob import exc
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
from xml.parsers import expat
from oslo.config import cfg
+from oslo.utils import timeutils
import webob.exc
from cinder.api import extensions
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
"""The QoS specs extension"""
+from oslo.utils import strutils
import six
import webob
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
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import strutils
import webob
from cinder.api import extensions
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
from oslo.config import cfg
+from oslo.utils import timeutils
import webob.exc
from cinder.api import extensions
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 oslo import messaging
+from oslo.utils import strutils
import webob
from cinder.api import extensions
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
import os
from oslo.config import cfg
+from oslo.utils import importutils
import webob.dec
import webob.exc
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
import time
from oslo.serialization import jsonutils
+from oslo.utils import importutils
import webob.dec
import webob.exc
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
"""The volumes snapshots api."""
+from oslo.utils import strutils
import webob
from webob import exc
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
import time
from oslo.serialization import jsonutils
+from oslo.utils import importutils
import webob.dec
import webob.exc
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
"""The volumes snapshots api."""
+from oslo.utils import strutils
import webob
from webob import exc
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
import datetime
-from cinder.openstack.common import timeutils
+from oslo.utils import timeutils
class ViewBuilder(object):
# 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)
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
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
@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):
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."""
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:
"""
# 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.
# 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." %
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)
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.
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():
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)
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__)
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
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
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
# 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',
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()
# 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)
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
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
from oslo.config import cfg
-
-from cinder.openstack.common import importutils
+from oslo.utils import importutils
db_driver_opt = cfg.StrOpt('db_driver',
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_
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
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()
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',
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 _
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
# 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',
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
+++ /dev/null
-# 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'))
+++ /dev/null
-# 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
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__)
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)
"""
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
# 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
import UserDict
from oslo.config import cfg
+from oslo.utils import timeutils
from cinder import db
from cinder import exception
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
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
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
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(
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
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
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
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
from oslo.config import cfg
from oslo.serialization import jsonutils
+from oslo.utils import timeutils
import webob
from webob import exc
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
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
from xml.dom import minidom
import mock
+from oslo.utils import timeutils
import webob
# needed for stubs to work
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
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
from datetime import datetime
+from oslo.utils import timeutils
import webob.exc
from cinder.api.contrib import services
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
import uuid
+from oslo.utils import timeutils
import routes
import webob
import webob.dec
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
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
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
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
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
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, {})
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')
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
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
from oslo.config import cfg
+from oslo.utils import importutils
from cinder import context
-from cinder.openstack.common import importutils
from cinder import test
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
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
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
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
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
#
"""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
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
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
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
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
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
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
import mock
from oslo.config import cfg
+from oslo.utils import timeutils
from cinder import backup
from cinder import context
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
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
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
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
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
# 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
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
import mock
from oslo.config import cfg
+from oslo.utils import timeutils
import paramiko
import six
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
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
"""
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
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
"""
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
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
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
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
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
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
"""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
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)
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
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
# 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)
import functools
from oslo.config import cfg
+from oslo.utils import excutils
+from oslo.utils import timeutils
import six
from cinder import context
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
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
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
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__)
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
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
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__)
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
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
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
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
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")
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
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
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
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
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
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
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
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
import shutil
from oslo.config import cfg
+from oslo.utils import units
from cinder import exception
from cinder.i18n import _
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
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
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
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
"""
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
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
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
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
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
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
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
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
import socket
import uuid
+from oslo.utils import timeutils
import six
from cinder import context
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
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
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):
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
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
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
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
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
import urllib
from oslo.config import cfg
+from oslo.utils import encodeutils
+from oslo.utils import units
import six
from cinder import exception
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:
"""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):
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:
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."""
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
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
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,
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):
"""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)
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)
"""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:
# 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.
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.
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__)
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
"""
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
"""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
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
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
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
import re
from oslo.config import cfg
+from oslo.utils import units
from cinder.brick.remotefs import remotefs
from cinder import exception
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
import time
from oslo.config import cfg
+from oslo.utils import timeutils
+from oslo.utils import units
import requests
from six import wraps
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
# 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:
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
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
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
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
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
"""
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
"""
+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
"""
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
module=fileutils
module=gettextutils
module=imageutils
-module=importutils
module=install_venv_common
module=jsonutils
module=local
module=log_handler
module=loopingcall
module=middleware
-module=network_utils
module=periodic_task
module=policy
module=processutils
module=service
module=strutils
module=timeutils
-module=units
module=uuidutils
module=versionutils
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