mock_api_req.side_effect = self._side_effect_api_req
# now run the test
- model_update = self.driver.create_export({}, {})
+ model_update = self.driver.create_export({}, {}, {})
# assert the result
self.assertEqual('CHAP fakeauthgroupchapuser fakeauthgroupchapsecret',
mock_api_req.side_effect = self._side_effect_api_req
# now run the test
- model_update = self.driver.create_export({}, {})
+ model_update = self.driver.create_export({}, {}, {})
# assert the result
self.assertEqual(None,
mock_api_req.side_effect = self._side_effect_api_req
# now run the test
- model_update = self.driver.create_export({}, {})
+ model_update = self.driver.create_export({}, {}, {})
# assert the result
self.assertEqual(None,
self.assertEqual(None, self.driver.ensure_export('', ''))
def test_create_export(self):
- self.assertEqual(None, self.driver.create_export('', ''))
+ self.assertEqual(None, self.driver.create_export('', '', {}))
def test_remove_export(self):
self.assertEqual(None, self.driver.remove_export('', ''))
'get_operational_network_interface_addresses',
mock.Mock(return_value=[]))
self.driver.create_volume(self.volume)
- updates = self.driver.create_export(None, self.volume)
+ updates = self.driver.create_export(None, self.volume, {})
self.assertTrue(updates['provider_location'])
self.volume['provider_location'] = updates['provider_location']
'get_operational_network_interface_addresses',
mock.Mock(return_value=[]))
self.driver.create_volume(self.volume)
- updates = self.driver.create_export(None, self.volume)
+ updates = self.driver.create_export(None, self.volume, {})
self.assertTrue(updates['provider_location'])
self.volume['provider_location'] = updates['provider_location']
connector_new = {'initiator': 'iqn.1993-08.org.debian:01:1001'}
self.assertDictEqual({'client_id': 2, 'volume': '616'}, c['data'])
self.driver.terminate_connection(None, None)
- self.driver.create_export(None, None)
+ self.driver.create_export(None, None, {})
self.driver.remove_export(None, None)
def test_stats(self):
self.driver.ensure_export(None, volume)
# Do nothing
- self.driver.create_export(None, volume)
+ self.driver.create_export(None, volume, {})
self.driver.remove_export(None, volume)
# Make sure volume attributes are as they should be
def test_create_export(self):
"""Test create_export."""
- self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg())
+ self._driver.create_export(mox.IgnoreArg(), mox.IgnoreArg(), {})
def test_ensure_export(self):
"""Test ensure_export."""
}
self.assertEqual(expected, self.driver.create_export(ctxt,
- self.volume))
+ self.volume,
+ {}))
def test_create_export_fails(self):
self.mock_api.side_effect = exception.DateraAPIException
ctxt = context.get_admin_context()
self.assertRaises(exception.DateraAPIException,
- self.driver.create_export, ctxt, self.volume)
+ self.driver.create_export, ctxt, self.volume, {})
def test_detach_volume_success(self):
self.mock_api.return_value = {}
self.mox.ReplayAll()
- export_info = drv.create_export(None, volume)
+ export_info = drv.create_export(None, volume, {})
self.assertEqual(initiator_name, export_info['provider_location'])
if chap_enabled:
model_update = None
try:
LOG.debug("Volume %s: creating export", volume['id'])
- model_update = self.create_export(context, volume)
+ model_update = self.create_export(context, volume, properties)
if model_update:
volume = self.db.volume_update(context, volume['id'],
model_update)
return
@abc.abstractmethod
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume.
Can optionally return a Dictionary of changes
def ensure_export(self, context, volume):
raise NotImplementedError()
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
raise NotImplementedError()
def remove_export(self, context, volume):
"""Synchronously recreates an export for a volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume.
Can optionally return a Dictionary of changes to the volume object to
volume_path)
return model_update
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
volume_path = self.local_path(volume)
export_info = self.target_driver.create_export(context,
volume,
user_id=snapshot['user_id'],
project_id=snapshot['project_id'])
- def create_export(self, _ctx, volume):
+ def create_export(self, _ctx, volume, connector):
"""Do nothing: target created during instance attachment."""
pass
# Request the CloudByte api to update the volume
self._api_request_for_cloudbyte('updateFileSystem', params)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Setup the iscsi export info."""
return self._export()
def ensure_export(self, context, volume):
return self._do_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self._do_export(context, volume)
def detach_volume(self, context, volume, attachment=None):
raise exception.VolumeBackendAPIException(
_('Failed to delete snapshot %s') % snapshot_id)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Create an export of a volume.
The volume exists on creation and will be visible on
self.__class__.__name__)
return stats
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
self.__class__.__name__)
return stats
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
volume,
volume_path)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
volume_path = self.local_path(volume)
export_info = self.target_driver.create_export(
context,
"""Driver entry point to get the export info for an existing volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
pass
"""Driver entry point to get the export info for an existing volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
pass
"""Driver entry point to get the export info for an existing volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
pass
"""Driver entry point to get the export info for an existing volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
pass
"""Driver entry point to get the export info for an existing volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
pass
'to volume "%s".'),
volume['name'])
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Create an export of a volume.
Driver has nothing to do here for the volume has been exported
self._ensure_share_mounted(volume['provider_location'])
- def create_export(self, ctx, volume):
+ def create_export(self, ctx, volume, connector):
"""Exports the volume."""
pass
"""Query the provider_id to figure out the proper devnode."""
return "/dev/" + self._get_space_name(volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
# Not needed for spaces
pass
def discard_zero_page(self, volume):
self.common.command.discard_zero_page(self.common.get_ldev(volume))
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
self.common.volume_info[ldev]['in_use']:
self._terminate_connection(ldev, connector, hostgroups)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
def ensure_export(self, context, volume):
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Create an export. Moved to initialize_connection.
:param context:
def migrate_volume(self, context, volume, host):
return (False, None)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Export a volume."""
pass
"""Synchronously recreates an export for a logical volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
LOG.error(_LE('ensure_export: Volume %s not found on storage.'),
volume['name'])
- def create_export(self, ctxt, volume):
+ def create_export(self, ctxt, volume, connector):
model_update = None
return model_update
return self.xiv_ds8k_proxy.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Create an export."""
return self.xiv_ds8k_proxy.create_export(context, volume)
"""Synchronously recreates an export for a volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume.
Can optionally return a Dictionary of changes
"""Synchronously recreates an export for a volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume.
Can optionally return a Dictionary of changes
self.target_driver.ensure_export(context, volume, volume_path)
return model_update
- def create_export(self, context, volume, vg=None):
+ def create_export(self, context, volume, connector, vg=None):
if vg is None:
vg = self.configuration.volume_group
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
def ensure_export(self, context, volume):
return self.library.ensure_export(context, volume)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.library.create_export(context, volume)
def remove_export(self, context, volume):
self._clone_volume_from_snapshot(volume, snapshot)
return self._get_model_info(volume['name'])
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
return self._get_model_info(volume['name'])
raise exception.VolumeBackendAPIException(data=msg)
return snapshotID
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
def ensure_export(self, context, volume):
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def _get_host(self, connector):
"""Synchronously recreates an export for a logical volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
"""Synchronously recreates an export for a logical volume."""
self._ensure_share_mounted(volume['provider_location'])
- def create_export(self, ctx, volume):
+ def create_export(self, ctx, volume, connector):
"""Exports the volume.
Can optionally return a dictionary of changes
host = common._get_3par_host(host['name'])
return host
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
return model_update
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
common = self._login()
try:
return self._do_export(common, volume)
def create_cloned_volume(self, volume, src_vref):
raise NotImplementedError()
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
def create_cloned_volume(self, volume, src_vref):
return self.proxy.create_cloned_volume(volume, src_vref)
- def create_export(self, context, volume):
- return self.proxy.create_export(context, volume)
+ def create_export(self, context, volume, connector):
+ return self.proxy.create_export(context, volume, connector)
def ensure_export(self, context, volume):
return self.proxy.ensure_export(context, volume)
optional)
return server_info
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
def ensure_export(self, context, volume):
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def remove_export(self, context, volume):
"""Synchronously recreates an export for a logical volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
"""Synchronously recreates an export for a logical volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume.
Can optionally return a Dictionary of changes to the volume
"""Safely and synchronously recreate an export for a logical volume."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Export a volume."""
pass
def ensure_export(self, context, volume):
return self.target_driver.ensure_export(context, volume, None)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.target_driver.create_export(
context,
volume,
if model_update:
self.db.volume_update(context, volume['id'], model_update)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Creates an export for a logical volume."""
self._attach_file(volume)
vg = self._get_lvm_vg(volume)
"%(msg)s"),
{'name': snapname, 'msg': e})
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def remove_export(self, context, volume):
"""Synchronously checks and re-exports volumes at cinder start time."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
"""Synchronously checks and re-exports volumes at cinder start time."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
"""Synchronously checks and re-exports volumes at cinder start time."""
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Exports the volume."""
pass
def terminate_connection(self, volume, connector, force=False, **kwargs):
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def ensure_export(self, context, volume):
# iSCSI targets exported by WinTarget persist after host reboot.
pass
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
"""Driver entry point to get the export info for a new volume."""
# Since the iSCSI targets are not reused, being deleted when the
# volume is detached, we should clean up existing targets before
def delete_snapshot(self, snapshot):
return self.driver.delete_snapshot(snapshot)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.driver.create_export(context, volume)
def ensure_export(self, context, volume):
def delete_snapshot(self, snapshot):
return self.driver.delete_snapshot(snapshot)
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
return self.driver.create_export(context, volume)
def ensure_export(self, context, volume):
self._update_volume_status()
return self._stats
- def create_export(self, context, volume):
+ def create_export(self, context, volume, connector):
pass
def remove_export(self, context, volume):
try:
model_update = self.driver.create_export(context.elevated(),
- volume)
+ volume, connector)
except exception.CinderException:
err_msg = (_("Create export for volume failed."))
LOG.exception(err_msg, resource=volume)