get_connector_properties(root_helper, CONF.my_ip, False, False).\
AndReturn(properties)
self.volume.driver._attach_volume(self.context, vol, properties).\
- AndReturn(attach_info)
+ AndReturn((attach_info, vol))
os.getuid()
utils.execute('chown', None, '/dev/null', run_as_root=True)
f = fileutils.file_open('/dev/null').AndReturn(file('/dev/null'))
get_connector_properties(root_helper, CONF.my_ip, False, False).\
AndReturn(properties)
self.volume.driver._attach_volume(self.context, vol, properties).\
- AndReturn(attach_info)
+ AndReturn((attach_info, vol))
os.getuid()
utils.execute('chown', None, '/dev/null', run_as_root=True)
f = fileutils.file_open('/dev/null', 'wb').AndReturn(file('/dev/null'))
dest_remote = True if remote in ['dest', 'both'] else False
dest_orig_status = dest_vol['status']
try:
- dest_attach_info = self._attach_volume(context,
- dest_vol,
- properties,
- remote=dest_remote)
+ dest_attach_info, dest_vol = self._attach_volume(
+ context,
+ dest_vol,
+ properties,
+ remote=dest_remote)
except Exception:
with excutils.save_and_reraise_exception():
msg = _("Failed to attach volume %(vol)s")
src_remote = True if remote in ['src', 'both'] else False
src_orig_status = src_vol['status']
try:
- src_attach_info = self._attach_volume(context,
- src_vol,
- properties,
- remote=src_remote)
+ src_attach_info, src_vol = self._attach_volume(context,
+ src_vol,
+ properties,
+ remote=src_remote)
except Exception:
with excutils.save_and_reraise_exception():
msg = _("Failed to attach volume %(vol)s")
enforce_multipath = self.configuration.enforce_multipath_for_image_xfer
properties = utils.brick_get_connector_properties(use_multipath,
enforce_multipath)
- attach_info = self._attach_volume(context, volume, properties)
+ attach_info, volume = self._attach_volume(context, volume, properties)
try:
image_utils.fetch_to_raw(context,
enforce_multipath = self.configuration.enforce_multipath_for_image_xfer
properties = utils.brick_get_connector_properties(use_multipath,
enforce_multipath)
- attach_info = self._attach_volume(context, volume, properties)
+ attach_info, volume = self._attach_volume(context, volume, properties)
try:
image_utils.upload_volume(context,
LOG.error(err_msg)
raise exception.VolumeBackendAPIException(data=ex_msg)
raise exception.VolumeBackendAPIException(data=err_msg)
- return self._connect_device(conn)
+ return (self._connect_device(conn), volume)
def _connect_device(self, conn):
# Use Brick's code to do attach/detach
enforce_multipath = self.configuration.enforce_multipath_for_image_xfer
properties = utils.brick_get_connector_properties(use_multipath,
enforce_multipath)
- attach_info = self._attach_volume(context, volume, properties)
+ attach_info, volume = self._attach_volume(context, volume, properties)
try:
volume_path = attach_info['device']['path']
enforce_multipath = self.configuration.enforce_multipath_for_image_xfer
properties = utils.brick_get_connector_properties(use_multipath,
enforce_multipath)
- attach_info = self._attach_volume(context, volume, properties)
+ attach_info, volume = self._attach_volume(context, volume, properties)
try:
volume_path = attach_info['device']['path']