Merge "Remove non-scheduler volume extend support"
This commit is contained in:
commit
5a8ce404f0
@ -2021,19 +2021,6 @@ class VolumeTestCase(base.BaseVolumeTestCase):
|
||||
volume_api.scheduler_rpcapi.extend_volume.assert_called_once_with(
|
||||
self.context, volume, 3, ["RESERVATION"], request_spec)
|
||||
|
||||
# Test direct volume path
|
||||
limit_check.side_effect = None
|
||||
reserve.side_effect = None
|
||||
db.volume_update(self.context, volume.id, {'status': 'available'})
|
||||
ext_mock = mock.MagicMock(side_effect=exception.ServiceTooOld)
|
||||
volume_api.volume_rpcapi.extend_volume = mock.MagicMock()
|
||||
volume_api.scheduler_rpcapi.extend_volume = ext_mock
|
||||
|
||||
volume_api.extend(self.context, volume, 3)
|
||||
|
||||
volume_api.volume_rpcapi.extend_volume.assert_called_once_with(
|
||||
self.context, volume, 3, ["RESERVATION"])
|
||||
|
||||
# clean up
|
||||
self.volume.delete_volume(self.context, volume)
|
||||
|
||||
|
@ -1350,20 +1350,8 @@ class API(base.Base):
|
||||
'volume_id': volume.id
|
||||
}
|
||||
|
||||
try:
|
||||
self.scheduler_rpcapi.extend_volume(context, volume, new_size,
|
||||
reservations, request_spec)
|
||||
except exception.ServiceTooOld as e:
|
||||
# NOTE(erlon): During rolling upgrades scheduler and volume can
|
||||
# have different versions. This check makes sure that a new
|
||||
# version of the volume service won't break.
|
||||
msg = ("Failed to send extend volume request to scheduler. "
|
||||
"Falling back to old behaviour. This is normal during a "
|
||||
"live-upgrade. Error: %(e)s")
|
||||
LOG.warning(msg, {'e': e})
|
||||
# TODO(erlon): Remove in Pike
|
||||
self.volume_rpcapi.extend_volume(context, volume, new_size,
|
||||
reservations)
|
||||
self.scheduler_rpcapi.extend_volume(context, volume, new_size,
|
||||
reservations, request_spec)
|
||||
|
||||
LOG.info("Extend volume request issued successfully.",
|
||||
resource=volume)
|
||||
|
Loading…
x
Reference in New Issue
Block a user