nova.virt.block_device.DriverBlockDevice cannot save to DB if bdm passed in was not already an object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Matt Riedemann |
Bug Description
This code doesn't work:
https:/
That will create a BlockDeviceMapping object to be wrapped in the DriverBlockDevice object (if a BDM object was not passed in). The problem is on self._bdm_
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "nova/tests/
File "nova/virt/
self.save()
File "nova/virt/
File "nova/virt/
File "/home/
oslo_
That's because the BDM object that was created doesn't have a context set on it.
And we can't pass context to self._bdm_
We've apparently never had a problem with this in runtime because we must always be constructing the DriverBlockDevice with a real BDM object in the compute code, we just weren't doing it properly in the tests - and the tests mock out nova.objects.
Changed in nova: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Matt Riedemann (mriedem) |
Fix proposed to branch: master /review. openstack. org/260685
Review: https:/