diff options
| author | Mark McLoughlin <markmc@redhat.com> | 2011-11-24 07:08:52 +0000 |
|---|---|---|
| committer | Mark McLoughlin <markmc@redhat.com> | 2011-11-24 07:08:52 +0000 |
| commit | d8301748152e10ba64b4cebb79d4dad139988cea (patch) | |
| tree | 8780dee6453a832fd9198c70b34d076e545e9fa6 /doc/source | |
| parent | 1670bccfa42c48e964c691e94c76359d56a73e59 (diff) | |
Remove boot-from-volume unreachable code path (#894172)
In http://review.openstack.org/1834 it was discovered that a
bool-from-volume code path in nova/compute/manager.py can never be
reached.
The code is basically:
if ((bdm['snapshot_id'] is not None) and
(bdm['volume_id'] is None)):
vol = volume_api.create(context, ...)
...
bdm['volume_id'] = vol['id']
if ((bdm['snapshot_id'] is not None) and
(bdm['volume_id'] is None)):
...
raise exception.ApiError(...)
(after applying De Morgan's laws to the expression in the second if
statement, that is)
It's obvious that the code path can only be reached if the volume
API's create() method can return a volume with id=None, but it can't
ever do this.
From:
https://code.launchpad.net/~yamahata/nova/boot-from-volume-0/+merge/62419
it looks like the author originally had this check as an assertion,
which makes more sense, but changed it to the current code following a
review comment.
Change-Id: I9f85028675f5dac8ab23bd150869eca421fc2fd0
Diffstat (limited to 'doc/source')
0 files changed, 0 insertions, 0 deletions
