volume = {'id': 111}
backend_volume = {'id': None}
rt = self.driver.update_migrated_volume(None, volume, backend_volume)
- mock_find_sc.assert_called_once_with(12345)
- mock_find_volume.assert_called_once_with(12345, None)
+ mock_find_sc.assert_called_once_with()
+ mock_find_volume.assert_called_once_with(None)
self.assertEqual(None, rt)
self.configuration.dell_sc_ssn = 12345
self.configuration.dell_sc_server_folder = 'opnstktst'
self.configuration.dell_sc_volume_folder = 'opnstktst'
+ # Note that we set this to True even though we do not
+ # test this functionality. This is sent directly to
+ # the requests calls as the verify parameter and as
+ # that is a third party library deeply stubbed out is
+ # not directly testable by this code. Note that in the
+ # case that this fails the driver fails to even come
+ # up.
+ self.configuration.dell_sc_verify_cert = True
self.configuration.dell_sc_api_port = 3033
self.configuration.iscsi_ip_address = '192.168.1.1'
self.configuration.iscsi_port = 3260
self.configuration.san_ip,
self.configuration.dell_sc_api_port,
self.configuration.san_login,
- self.configuration.san_password)
+ self.configuration.san_password,
+ self.configuration.dell_sc_verify_cert)
# Set up the scapi configuration vars
self.scapi.ssn = self.configuration.dell_sc_ssn
self.configuration.dell_sc_ssn = 12345
self.configuration.dell_sc_server_folder = 'openstack'
self.configuration.dell_sc_volume_folder = 'openstack'
+ # Note that we set this to True even though we do not
+ # test this functionality. This is sent directly to
+ # the requests calls as the verify parameter and as
+ # that is a third party library deeply stubbed out is
+ # not directly testable by this code. Note that in the
+ # case that this fails the driver fails to even come
+ # up.
+ self.configuration.dell_sc_verify_cert = True
self.configuration.dell_sc_api_port = 3033
self.configuration.iscsi_ip_address = '192.168.1.1'
self.configuration.iscsi_port = 3260
self.configuration.san_ip,
self.configuration.dell_sc_api_port,
self.configuration.san_login,
- self.configuration.san_password)
+ self.configuration.san_password,
+ self.configuration.dell_sc_verify_cert)
# Set up the scapi configuration vars
self.scapi.ssn = self.configuration.dell_sc_ssn
Helper for making the REST calls.
'''
- def __init__(self, host, port, user, password):
+ def __init__(self, host, port, user, password, verify):
self.baseUrl = 'https://%s:%s/api/rest/' % (host, port)
self.session = requests.Session()
self.session.auth = (user, password)
self.header = {}
self.header['Content-Type'] = 'application/json; charset=utf-8'
self.header['x-dell-api-version'] = '2.0'
- self.verify = False
+ self.verify = verify
def __enter__(self):
return self
connection = StorageCenterApi(self.config.san_ip,
self.config.dell_sc_api_port,
self.config.san_login,
- self.config.san_password)
+ self.config.san_password,
+ self.config.dell_sc_verify_cert)
# This instance is for a single backend. That backend has a
# few items of information we should save rather than passing them
# about.
APIVERSION = '1.0.1'
- def __init__(self, host, port, user, password):
+ def __init__(self, host, port, user, password, verify):
self.notes = 'Created by Dell Cinder Driver'
self.ssn = None
self.vfname = 'openstack'
self.client = HttpClient(host,
port,
user,
- password)
+ password,
+ verify)
def __enter__(self):
return self
help='Name of the server folder to use on the Storage Center'),
cfg.StrOpt('dell_sc_volume_folder',
default='openstack',
- help='Name of the volume folder to use on the Storage Center')
+ help='Name of the volume folder to use on the Storage Center'),
+ cfg.BoolOpt('dell_sc_verify_cert',
+ default=False,
+ help='Enable HTTPS SC certificate verification.')
]
LOG = logging.getLogger(__name__)
'o': original_volume_name})
if original_volume_name:
with self._client.open_connection() as api:
- ssn = api.find_sc(self.configuration.dell_sc_ssn)
- if ssn is not None:
- scvolume = api.find_volume(ssn,
- current_name)
- if scvolume:
- if api.rename_volume(scvolume, original_volume_name):
- model_update = {'_name_id': None}
- return model_update
+ if api.find_sc():
+ scvolume = api.find_volume(current_name)
+ if (scvolume and
+ api.rename_volume(scvolume, original_volume_name)):
+ model_update = {'_name_id': None}
+ return model_update
# The world was horrible to us so we should error and leave.
- LOG.error(_LE('Unabled to rename the logical volume for volume: %s'),
+ LOG.error(_LE('Unable to rename the logical volume for volume: %s'),
original_volume_name)
return None