The 3PAR and LeftHand drivers were raising the wrong exception,
VolumeBackendAPIException, instead of InvalidReplicationTarget,
which was putting the host in an unrecoverable state,
Change-Id: I1c0ee4adb399dd1e89669477c53f79332a9f79ef
Closes-Bug: #
1556150
volumes = [self.volume_replicated]
# Test invalid secondary target.
self.assertRaises(
- exception.VolumeBackendAPIException,
+ exception.InvalidReplicationTarget,
self.driver.failover_host,
context.get_admin_context(),
volumes,
# Test no secondary target.
self.assertRaises(
- exception.VolumeBackendAPIException,
+ exception.InvalidReplicationTarget,
self.driver.failover_host,
context.get_admin_context(),
volumes,
volume['replication_status'] = 'failed-over'
self.assertRaises(
- exception.VolumeDriverException,
+ exception.InvalidReplicationTarget,
self.driver.failover_host,
context.get_admin_context(),
[volume],
# Test invalid secondary target.
self.assertRaises(
- exception.VolumeBackendAPIException,
+ exception.InvalidReplicationTarget,
self.driver.failover_host,
ctxt,
[self.volume_replicated],
volume = self.volume_replicated.copy()
self.assertRaises(
- exception.VolumeDriverException,
+ exception.InvalidReplicationTarget,
self.driver.failover_host,
context.get_admin_context(),
[volume],
msg = _("A valid secondary target MUST be specified in order "
"to failover.")
LOG.error(msg)
- raise exception.VolumeBackendAPIException(data=msg)
+ raise exception.InvalidReplicationTarget(reason=msg)
target_id = failover_target['backend_id']
# For each volume, if it is replicated, we want to fail it over.
"resynchronize the volumes and resume replication on the "
"3PAR backends.")
LOG.error(msg)
- raise exception.VolumeDriverException(data=msg)
+ raise exception.InvalidReplicationTarget(reason=msg)
# Update the volumes status to available.
volume_update_list = []
msg = _("A valid secondary target MUST be specified in order "
"to failover.")
LOG.error(msg)
- raise exception.VolumeBackendAPIException(data=msg)
+ raise exception.InvalidReplicationTarget(reason=msg)
target_id = failover_target['backend_id']
self._active_backend_id = target_id
"resynchronize the volumes and resume replication on the "
"LeftHand backends.")
LOG.error(msg)
- raise exception.VolumeDriverException(data=msg)
+ raise exception.InvalidReplicationTarget(reason=msg)
cl = None
volume_update_list = []