preauthtoken=self.context.auth_token,
starting_backoff=self.swift_backoff)
- class SwiftObjectWriter:
+ class SwiftObjectWriter(object):
def __init__(self, container, object_name, conn):
self.container = container
self.object_name = object_name
raise exception.InvalidBackup(reason=err)
return md5
- class SwiftObjectReader:
+ class SwiftObjectReader(object):
def __init__(self, container, object_name, conn):
self.container = container
self.object_name = object_name
'{"barAction": true}')
def test_get_method_action_method(self):
- class Controller():
+ class Controller(object):
def action(self, req, pants=None):
return pants
return 'Example function'
-class ExampleClassA():
+class ExampleClassA(object):
def example_method(self):
return 'Example method'
return 'Example function'
-class ExampleClassB():
+class ExampleClassB(object):
def example_method(self):
return 'Example method'
VOLUME_PATH = '/dev/null'
-class TSMBackupSimulator:
+class TSMBackupSimulator(object):
"""Simulates TSM dsmc command.
The simulator simulates the execution of the 'dsmc' command.
self.DesiredCopyMethodology = 0
-class Fake_CIMProperty():
+class Fake_CIMProperty(object):
def fake_getCIMProperty(self):
cimproperty = Fake_CIMProperty()
return cimproperty
-class Fake_CIM_TierPolicyServiceCapabilities():
+class Fake_CIM_TierPolicyServiceCapabilities(object):
def fake_getpolicyinstance(self):
classinstance = Fake_CIM_TierPolicyServiceCapabilities()
return instancename
-class FakeDB():
+class FakeDB(object):
def volume_update(self, context, volume_id, model_update):
pass
return snapshots
-class EMCVMAXCommonData():
+class EMCVMAXCommonData(object):
wwpn1 = "123456789012345"
wwpn2 = "123456789054321"
connector = {'ip': '10.0.0.2',
'isV3': True}
-class FakeLookupService():
+class FakeLookupService(object):
def get_device_mapping_from_network(self, initiator_wwns, target_wwns):
return EMCVMAXCommonData.device_map
-class FakeEcomConnection():
+class FakeEcomConnection(object):
def __init__(self, *args, **kwargs):
self.data = EMCVMAXCommonData()
VERSION = emc_vnx_cli.EMCVnxCliBase.VERSION
-class EMCVNXCLIDriverTestData():
+class EMCVNXCLIDriverTestData(object):
test_volume = {
'name': 'vol1',
fake_cli.assert_has_calls(expect_cmd)
-class EMCVNXCLIToggleSPTestData():
+class EMCVNXCLIToggleSPTestData(object):
def FAKE_COMMAND_PREFIX(self, sp_address):
return ('/opt/Navisphere/bin/naviseccli', '-address', sp_address,
'-user', 'sysadmin', '-password', 'sysadmin',
return dict.update(self, *args, **kwargs)
-class CommonData():
+class CommonData(object):
connector = {'ip': '10.0.0.2',
'initiator': 'iqn.1993-08.org.debian:01:222',
'wwpns': ["123456789012345", "123456789054321"],
"""
-class SimulatedHusBackend:
+class SimulatedHusBackend(object):
"""Simulation Back end. Talks to HUS."""
alloc_lun = [] # allocated LUs
def test_initialize_connection_with_lookup_single_nsp(self, mock_lookup):
# setup_mock_client drive with default configuration
# and return the mock HTTP 3PAR client
- class fake_lookup_object:
+ class fake_lookup_object(object):
def get_device_mapping_from_network(self, connector, target_wwns):
fake_map = {
'FAB_1': {
def test_terminate_connection_with_lookup(self, mock_lookup):
# setup_mock_client drive with default configuration
# and return the mock HTTP 3PAR client
- class fake_lookup_object:
+ class fake_lookup_object(object):
def get_device_mapping_from_network(self, connector, target_wwns):
fake_map = {
'FAB_1': {
"capabilities.total_volumes < 400 && capabilities.capacity_utilization"
-class HPLeftHandBaseDriver():
+class HPLeftHandBaseDriver(object):
cluster_id = 1
LOG = logging.getLogger(__name__)
-class FlashSystemManagementSimulator:
+class FlashSystemManagementSimulator(object):
def __init__(self):
# Default protocol is FC
self._protocol = 'FC'
CALLED = {}
-class MockVDiskController():
+class MockVDiskController(object):
def create_volume(self, location, size):
CALLED['create_volume'] = {'location': location, 'size': size}
'diskguid': diskguid}
-class MockStorageRouter():
+class MockStorageRouter(object):
name = MOCK_hostname
-class MockStorageDriver():
+class MockStorageDriver(object):
storagerouter = MockStorageRouter()
mountpoint = MOCK_mountpoint
-class MockVPool():
+class MockVPool(object):
storagedrivers = [MockStorageDriver()]
-class MockVDisk():
+class MockVDisk(object):
vpool = MockVPool()
cinder_id = None
snapshots = []
pass
-class MockPMachine():
+class MockPMachine(object):
guid = MOCK_pmachine_guid
storagerouters = [MockStorageRouter()]
pass
-class MockVPoolList():
+class MockVPoolList(object):
def get_vpool_by_name(self, name):
return MockVPool()
-class MockVDiskList():
+class MockVDiskList(object):
def __init__(self, vdisks = None):
self.vdisks = vdisks
return self.vdisks
-class MockPMachineList():
+class MockPMachineList(object):
def get_pmachines(self):
return [MockPMachine()]
-class MOCK_log():
+class MOCK_log(object):
def debug(self, *args, **kwargs):
pass
pass
-class MOCK_Context():
+class MOCK_Context(object):
pass
-class MOCK_ImageService():
+class MOCK_ImageService(object):
pass
-class MOCK_ImageUtils():
+class MOCK_ImageUtils(object):
def fetch_to_raw(self, context, image_service, image_id, destination_path,
block_size, size, run_as_root=False):
CALLED['ImageUtils_fetch_to_raw'] = (destination_path, size)
-class MOCK_volume():
+class MOCK_volume(object):
host = MOCK_hostname
size = MOCK_volume_size
volume_type_id = MOCK_volume_type_id
return getattr(self, attribute)
-class MOCK_snapshot():
+class MOCK_snapshot(object):
volume = MOCK_volume()
display_name = MOCK_snapshot_display_name
id = MOCK_snapshot_id
# Fake Modules
-class vdiskhybrid():
+class vdiskhybrid(object):
VDisk = MockVDisk
-class pmachinelist():
+class pmachinelist(object):
PMachineList = MockPMachineList()
-class vdisklist():
+class vdisklist(object):
def __init__(self, vdisks):
self.VDiskList = MockVDiskList(vdisks)
-class vpoollist():
+class vpoollist(object):
VPoolList = MockVPoolList()
-class vdisklib():
+class vdisklib(object):
VDiskController = MockVDiskController()
"""
-class FakeImageService:
+class FakeImageService(object):
def download(self, context, image_id, path):
pass
def test_copy_image_to_volume(self):
@contextlib.contextmanager
def fake_temp_file():
- class FakeTmp:
+ class FakeTmp(object):
def __init__(self, name):
self.name = name
yield FakeTmp('test').name
LOG = logging.getLogger(__name__)
-class StorwizeSVCManagementSimulator:
+class StorwizeSVCManagementSimulator(object):
def __init__(self, pool_name):
self._flags = {'storwize_svc_volpool_name': pool_name}
self._volumes_list = {}
@mock.patch('os.stat')
def test_get_file_mode(self, mock_stat):
-
- class stat_result:
+ class stat_result(object):
st_mode = 0o777
st_gid = 33333
@mock.patch('os.stat')
def test_get_file_gid(self, mock_stat):
- class stat_result:
+ class stat_result(object):
st_mode = 0o777
st_gid = 33333
@mock.patch('os.stat')
def test_get_file_size(self, mock_stat):
- class stat_result:
+ class stat_result(object):
st_mode = 0o777
st_size = 1074253824
@mock.patch('os.stat')
def test_get_blkdev_major_minor(self, mock_stat):
- class stat_result:
+ class stat_result(object):
st_mode = 0o60660
st_rdev = os.makedev(253, 7)
test_file = '/tmp/file'
test_disk = '/dev/made_up_disk'
- class stat_result_file:
+ class stat_result_file(object):
st_mode = 0o660
- class stat_result_partition:
+ class stat_result_partition(object):
st_mode = 0o60660
st_rdev = os.makedev(8, 65)
- class stat_result_disk:
+ class stat_result_disk(object):
st_mode = 0o60660
st_rdev = os.makedev(8, 64)
FAKE_UUID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa'
-class FakeImageService:
+class FakeImageService(object):
def __init__(self, db_driver=None, image_service=None):
pass
LOG = logging.getLogger("cinder.volume.driver")
-class HusBackend:
+class HusBackend(object):
"""Back end. Talks to HUS."""
def get_version(self, cmd, ver, ip0, ip1, user, pw):
out, err = utils.execute(cmd,
return inner_connection_checker
-class NimbleAPIExecutor:
+class NimbleAPIExecutor(object):
"""Makes Nimble API calls."""
'(:\d+)?/[a-zA-Z0-9\-_\/]*$')
-class retry:
+class retry(object):
SLEEP_NONE = 'none'
SLEEP_DOUBLE = 'double'
SLEEP_INCREMENT = 'increment'
LOG.debug("Invalid spec value: %s specified.", spec_value)
-class ImageDiskType:
+class ImageDiskType(object):
"""Supported disk types in images."""
PREALLOCATED = "preallocated"
# Due to the upgrade to hacking 0.10.0 the following checking are
# ignored on purpose for the moment and should be cleaned up and re-enabled.
#
-# H238 old style class declaration, use new style (inherit from `object`)
# H105 Don't use author tags
#
-ignore = E251,H405,H238,H105
+ignore = E251,H405,H105
exclude = .git,.venv,.tox,dist,tools,doc,common,*egg,build
max-complexity=30