warnings.simplefilter('once', DeprecationWarning)
import eventlet
+from oslo.config import cfg
eventlet.monkey_patch()
-from oslo.config import cfg
-
# If ../cinder/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
"""Starter script for Cinder Volume."""
-import eventlet
import os
+import eventlet
+
if os.name == 'nt':
# eventlet monkey patching the os module causes subprocess.Popen to fail
# on Windows when using pipes due to missing non-blocking IO support.
from cinder import i18n
i18n.enable_lazy()
-
from cinder import context
from cinder import db
from cinder.i18n import _
"""The hosts admin extension."""
+from xml.parsers import expat
from oslo.config import cfg
import webob.exc
-from xml.parsers import expat
from cinder.api import extensions
from cinder.api.openstack import wsgi
# License for the specific language governing permissions and limitations
# under the License.
-import webob
from oslo import messaging
+import webob
from cinder.api import extensions
from cinder.api.openstack import wsgi
from cinder.api.openstack import wsgi
from cinder.api.views import transfers as transfer_view
from cinder.api import xmlutil
-
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import log as logging
import inspect
import math
import time
+from xml.dom import minidom
+from xml.parsers import expat
from lxml import etree
import six
import webob
-from xml.dom import minidom
-from xml.parsers import expat
from cinder import exception
from cinder import i18n
# License for the specific language governing permissions and limitations
# under the License.
-import paste.urlmap
import re
import urllib2
+import paste.urlmap
+
from cinder.api.openstack import wsgi
from cinder.openstack.common import log as logging
# under the License.
import webob
+from webob import exc
from cinder.api import common
from cinder.api.openstack import wsgi
from cinder import exception
from cinder.i18n import _
from cinder import volume
-from webob import exc
class Controller(wsgi.Controller):
# under the License.
import webob
+from webob import exc
from cinder.api import common
from cinder.api.openstack import wsgi
from cinder import exception
from cinder.i18n import _
from cinder import volume
-from webob import exc
class Controller(wsgi.Controller):
"""The volumes api."""
import ast
+
import webob
from webob import exc
# under the License.
import webob
+from webob import exc
from cinder.api import common
from cinder.api.openstack import wsgi
from cinder import exception
from cinder.i18n import _
from cinder import volume
-from webob import exc
class Controller(wsgi.Controller):
import ast
+
import webob
from webob import exc
from eventlet import greenthread
-
from oslo.config import cfg
from cinder.backup import rpcapi as backup_rpcapi
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import log as logging
-from cinder import utils
-
import cinder.policy
+from cinder import utils
import cinder.volume
CONF = cfg.CONF
"""Base class for all backup drivers."""
+from oslo.config import cfg
+
from cinder.db import base
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import jsonutils
from cinder.openstack.common import log as logging
-from oslo.config import cfg
service_opts = [
cfg.IntOpt('backup_metadata_version', default=1,
restore to a new volume (default).
"""
-import eventlet
import fcntl
import os
import re
import subprocess
import time
+import eventlet
from oslo.config import cfg
from cinder.backup.driver import BackupDriver
import hashlib
import json
import os
-import six
import socket
import eventlet
from oslo.config import cfg
+import six
+from swiftclient import client as swift
from cinder.backup.driver import BackupDriver
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 swiftclient import client as swift
LOG = logging.getLogger(__name__)
LVM class for performing LVM operations.
"""
+import itertools
import math
import re
-import itertools
-
from cinder.brick import exception
from cinder.brick import executor
from cinder.i18n import _
import hashlib
import os
import re
+
import six
from cinder.brick import exception
import uuid
-from cinder.openstack.common import log as logging
from migrate import ForeignKeyConstraint
from sqlalchemy import Integer, MetaData, String, Table
+from cinder.openstack.common import log as logging
+
LOG = logging.getLogger(__name__)
# under the License.
-from cinder.openstack.common import log as logging
from sqlalchemy import Column
from sqlalchemy import MetaData, String, Table
+from cinder.openstack.common import log as logging
+
LOG = logging.getLogger(__name__)
import datetime
-from cinder.i18n import _
-from cinder.openstack.common import log as logging
from oslo.config import cfg
from sqlalchemy import MetaData, Table
+from cinder.i18n import _
+from cinder.openstack.common import log as logging
+
# Get default values via config. The defaults will either
# come from the default values set in the quota option
# configuration or via cinder.conf if the user has configured
SQLAlchemy models for cinder data.
"""
-
+from oslo.config import cfg
+from oslo.db.sqlalchemy import models
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
-from oslo.config import cfg
-from oslo.db.sqlalchemy import models
from cinder.openstack.common import timeutils
"""
-import six
import sys
from oslo.config import cfg
+import six
import webob.exc
from cinder.i18n import _
"""
+import logging
import os
import shutil
import tempfile
import uuid
import fixtures
-import logging
import mox
from oslo.config import cfg
from oslo.messaging import conffixture as messaging_conffixture
import ast
import tempfile
-import webob
from oslo.config import cfg
+import webob
from cinder.api.contrib import admin_actions
from cinder.brick.local_dev import lvm as brick_lvm
"""
import json
-import mock
from xml.dom import minidom
+import mock
import webob
# needed for stubs to work
# License for the specific language governing permissions and limitations
# under the License.
-from lxml import etree
from xml.dom import minidom
+from lxml import etree
import webob
from cinder.api.contrib import qos_specs_manage
# under the License.
+from datetime import datetime
+
import webob.exc
from cinder.api.contrib import services
from cinder import policy
from cinder import test
from cinder.tests.api import fakes
-from datetime import datetime
fake_services_list = [{'binary': 'cinder-scheduler',
# under the License.
from lxml import etree
-import webob
-
import mock
+import webob
from cinder.api.contrib import types_extra_specs
from cinder import exception
# under the License.
import json
+
import webob
from cinder.api.contrib import volume_encryption_metadata
# under the License.
import mock
-
import webob
from cinder import context
# under the License.
import json
+
import webob
from cinder import context
# under the License.
import mock
-
import webob
from cinder import context
# License for the specific language governing permissions and limitations
# under the License.
+import gettext
from xml.dom import minidom
-import gettext
import mock
from oslo.i18n import _lazy
import webob.dec
# under the License.
import inspect
+
import webob
from cinder.api.openstack import wsgi
"""
import httplib
-import six
from xml.dom import minidom
from lxml import etree
+import six
import webob
from cinder.api.v1 import limits
"""
import httplib
+from xml.dom import minidom
from lxml import etree
import six
import webob
-from xml.dom import minidom
from cinder.api.v2 import limits
from cinder.api import views
import socket
import zlib
-from cinder.openstack.common import log as logging
from swiftclient import client as swift
+from cinder.openstack.common import log as logging
+
LOG = logging.getLogger(__name__)
#
"""Fake HP client for testing 3PAR without installing the client."""
-import mock
import sys
+import mock
+
from cinder.tests import fake_hp_client_exceptions as hpexceptions
hp3par = mock.Mock()
#
"""Fake HP client for testing LeftHand without installing the client."""
-import mock
import sys
+import mock
+
from cinder.tests import fake_hp_client_exceptions as hpexceptions
hplefthand = mock.Mock()
import netaddr
import requests
-
import six.moves.urllib.parse as urlparse
from cinder.i18n import _
# License for the specific language governing permissions and limitations
# under the License.
-import testtools
import time
+import testtools
+
from cinder.openstack.common import log as logging
from cinder import service
from cinder.tests import fake_driver
"""
import mock
-
from oslo.config import cfg
from cinder import context
"""
import mock
-
from oslo.config import cfg
from cinder import exception
"""
import copy
-import mock
+import mock
from oslo.config import cfg
from cinder import context
"""
import mock
-
from oslo.config import cfg
from cinder import context
"""
-import mock
import tempfile
+import mock
from oslo.config import cfg
from cinder import context
import contextlib
import hashlib
-import mock
import os
-import six
import tempfile
import uuid
+import mock
+import six
+
from cinder.backup import driver
from cinder.backup.drivers import ceph
from cinder import context
# under the License.
""" Tests for the backup service base driver. """
-import mock
import uuid
+import mock
+
from cinder.backup import driver
from cinder import context
from cinder import db
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-import mock
+
import os
import re
+import mock
+
from cinder import exception
from cinder.openstack.common import processutils
from cinder import test
import contextlib
import errno
-import mock
import os
import tempfile
import time
import traceback
+import mock
import mox as mox_lib
from mox import IgnoreArg
from mox import IsA
# License for the specific language governing permissions and limitations
# under the License.
-import mock
import os
import tempfile
+import mock
from oslo.config import cfg
from cinder import context
Self test for Hitachi Unified Storage (HUS) platform.
"""
-import mox
import os
import tempfile
+import mox
+
from cinder import test
from cinder.volume import configuration as conf
from cinder.volume.drivers.hds import hds
import mock
+from cinder.openstack.common import log as logging
from cinder import test
from cinder.volume import configuration as conf
from cinder.volume.drivers.hds import iscsi
-
-from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
HNASCONF = """<?xml version="1.0" encoding="UTF-8" ?>
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_fc as hpfcdriver
from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver
"""Unit tests for OpenStack Cinder HP MSA driver."""
+import urllib2
+
import lxml.etree as etree
import mock
-import urllib2
from cinder import exception
from cinder import test
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
from cinder.volume.drivers.san.hp import hp_lefthand_rest_proxy
"""
import json
-import mox
import os
import shutil
import tempfile
import time
-
from xml.dom.minidom import Document
+import mox
+
from cinder import exception
from cinder import test
from cinder.volume import configuration as conf
Unit Tests for Huawei T and Dorado volume drivers.
"""
-import mox
import os
import shutil
import socket
import tempfile
import time
-
from xml.dom.minidom import Document
from xml.etree import ElementTree as ET
+import mox
+
from cinder import context
from cinder import exception
from cinder import ssh_utils
"""
import mock
-
from oslo.config import cfg
from cinder import context
"""Unit tests for image utils."""
import contextlib
-import mock
-import mox
import tempfile
+import mock
+import mox
from oslo.config import cfg
from cinder import context
import BaseHTTPServer
import httplib
-from lxml import etree
+from lxml import etree
import six
from cinder import exception
"""
import json
-import mock
import re
+
+import mock
import requests
from cinder import exception
# under the License.
"""Unit tests for the NetApp-specific NFS driver module."""
+import os
+
from lxml import etree
import mock
import mox
from mox import IgnoreArg
from mox import IsA
-import os
from cinder import context
from cinder import exception
import BaseHTTPServer
import copy
import httplib
+
from lxml import etree
from mox import IgnoreArg
-
import six
from cinder import exception
# under the License.
import mock
-
from oslo.config import cfg
from cinder import exception
# under the License.
import json
-import mock
import urllib2
+import mock
+
from cinder import exception
from cinder.openstack.common import processutils
from cinder.openstack.common import units
import math
-import mock
import os
import tempfile
+import mock
+
from cinder import db
from cinder import exception
from cinder.i18n import _
Tests for the IBM Storwize family and SVC volume driver.
"""
-import mock
import random
import re
import time
+import mock
+
from cinder import context
from cinder import exception
from cinder.i18n import _
import contextlib
import datetime
-import mock
import os
import shutil
import socket
import tempfile
import eventlet
+import mock
import mox
from oslo.config import cfg
from stevedore import extension
"""Tests For miscellaneous util methods used with volume."""
-import mock
import os
import re
+import mock
from oslo.config import cfg
from cinder import context
"""Unit tests for `cinder.wsgi`."""
-import mock
import os.path
import tempfile
import urllib2
+import mock
from oslo.config import cfg
from oslo.i18n import _lazy
import testtools
Mock unit tests for the NetApp iSCSI driver
"""
-import mock
import uuid
+import mock
+
from cinder import test
import cinder.volume.drivers.netapp.api as ntapi
import cinder.volume.drivers.netapp.iscsi as ntap_iscsi
import shutil
import tempfile
-from oslo.config import cfg
-
import mox
-
-from cinder import test
+from oslo.config import cfg
from cinder.image import image_utils
-
from cinder.openstack.common import fileutils
+from cinder import test
from cinder.tests.windows import db_fakes
from cinder.volume import configuration as conf
from cinder.volume.drivers.windows import constants
"""Unit tests for brcd fc san lookup service."""
import mock
-import paramiko
-
from oslo.config import cfg
+import paramiko
from cinder import exception
from cinder.openstack.common import log as logging
"""Unit tests for brcd fc zone client cli."""
import mock
+from mock import patch
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.zonemanager.drivers.brocade.brcd_fc_zone_client_cli \
import BrcdFCZoneClientCLI
import cinder.zonemanager.drivers.brocade.fc_zone_constants as ZoneConstant
-from mock import patch
LOG = logging.getLogger(__name__)
"""Unit tests for Brocade fc zone driver."""
import mock
-import paramiko
-
from oslo.config import cfg
+import paramiko
from cinder import exception
from cinder.i18n import _
"""Unit tests for FC Zone Manager."""
import mock
+from mock import Mock
from cinder import exception
from cinder import test
from cinder.volume import configuration as conf
from cinder.zonemanager.drivers.fc_zone_driver import FCZoneDriver
from cinder.zonemanager import fc_zone_manager
-from mock import Mock
fabric_name = 'BRCD_FAB_3'
init_target_map = {'10008c7cff523b01': ['20240002ac000a50']}
import stat
import sys
import tempfile
-
-from oslo.config import cfg
-import six
from xml.dom import minidom
from xml.parsers import expat
from xml import sax
from xml.sax import expatreader
from xml.sax import saxutils
+from oslo.config import cfg
+import six
+
from cinder.brick.initiator import connector
from cinder import exception
from cinder.i18n import _
"""
import time
+from xml.dom.minidom import parseString
from oslo.config import cfg
-from xml.dom.minidom import parseString
from cinder import exception
from cinder.i18n import _
iSCSI Cinder Volume driver for Hitachi Unified Storage (HUS) platform.
"""
-from oslo.config import cfg
from xml.etree import ElementTree as ETree
+from oslo.config import cfg
+
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import excutils
Hitachi Unified Storage (HUS-HNAS) platform. Backend operations.
"""
+import re
+
from cinder.openstack.common import log as logging
from cinder.openstack.common import units
from cinder import utils
-import re
LOG = logging.getLogger("cinder.volume.driver")
iSCSI Cinder Volume driver for Hitachi Unified Storage (HUS-HNAS) platform.
"""
-from oslo.config import cfg
from xml.etree import ElementTree as ETree
+from oslo.config import cfg
+
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import excutils
import os
import time
+from xml.etree import ElementTree as ETree
from oslo.config import cfg
-from xml.etree import ElementTree as ETree
from cinder import exception
from cinder.i18n import _
import time
import urllib2
import uuid
-
from xml.etree import ElementTree as ET
from cinder import context
import socket
import threading
import time
-
from xml.etree import ElementTree as ET
from cinder import context
import random
import re
-import six
import unicodedata
from eventlet import greenthread
+import six
from cinder import context
from cinder import exception
Contains classes required to issue api calls to ONTAP and OnCommand DFM.
"""
-from lxml import etree
import urllib2
+from lxml import etree
+
from cinder.i18n import _
from cinder.openstack.common import log as logging
"""
import json
-import requests
+import requests
import six.moves.urllib.parse as urlparse
from cinder import exception
# under the License.
import errno
+
import six
from cinder import exception
import json
import math
import os
-import six
import tempfile
import urllib
from oslo.config import cfg
+import six
from cinder import exception
from cinder.i18n import _
#
"""HP LeftHand SAN ISCSI REST Proxy."""
+from oslo.config import cfg
+
from cinder import context
from cinder import exception
from cinder.i18n import _
from cinder.volume.driver import ISCSIDriver
from cinder.volume import utils
from cinder.volume import volume_types
-from oslo.config import cfg
LOG = logging.getLogger(__name__)
"""
import httplib
-import netaddr
import urllib
import urllib2
+import netaddr
import six.moves.urllib.parse as urlparse
from cinder.i18n import _
# F841,H302,H305,H307,H405
-ignore = E251,E265,H302,H305,H307,H402,H405,H803,H904
+ignore = E251,E265,H302,H402,H405,H803,H904
builtins = _
exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build