From 56d3f4657c446360db53779cf025d40a44bf04bb Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 8 Oct 2019 17:28:00 -0400 Subject: [PATCH] Remove dead reserve_volume compat code in _validate_bdm Change I3cc775fc7dafe691b97a15e50ae2e93c92f355be in Rocky added compat code in _validate_bdm for when a boot-from-volume request ends up using the legacy attachment flow and _check_attach_and_reserve_volume was not called or did not set bdm.attachment_id. The legacy flow compat code was removed in Train in change I6a777b4b7a5729488f939df8c40e49bd40aec3dd so we can remove the now dead condition in _validate_bdm because the bdm.attachment_id is always going to be set on a pre-existing volume during boot from volume. Change-Id: Ia1071ff1cb31e57f73e40eeb9b1531a7b1996cae --- nova/compute/api.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/nova/compute/api.py b/nova/compute/api.py index 0a50898ae9..f551bcf68d 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1585,13 +1585,6 @@ class API(base.Base): self._check_attach_and_reserve_volume( context, volume, instance, bdm, supports_multiattach) bdm.volume_size = volume.get('size') - - # NOTE(mnaser): If we end up reserving the volume, it will - # not have an attachment_id which is needed - # for cleanups. This can be removed once - # all calls to reserve_volume are gone. - if 'attachment_id' not in bdm: - bdm.attachment_id = None except (exception.CinderConnectionFailed, exception.InvalidVolume, exception.MultiattachNotSupportedOldMicroversion):