Commit e238cc9
committed
Allow deletion of compute service with no compute nodes
Consider the following situation:
- Using the Ironic virt driver
- Replacing (so removing and re-adding) all baremetal nodes
associated with a single nova-compute service
The update resources periodic will have destroyed the compute node
records because they're no longer being reported by the virt driver.
If we then attempt to manually delete the compute service record, the
datbase layer will raise an exception, as there are no longer any
compute node records for the host. Previously, this exception would
get bubbled up as an error 500 in the API. This patch catches it and
allows service deletion to complete succefully.
Closes bug: 1860312
Change-Id: I2f9ad3df25306e070c8c3538bfed1212d6d8682f
(cherry picked from commit 880611d)
(cherry picked from commit df5158b)1 parent 9efdd0b commit e238cc9
File tree
2 files changed
+20
-9
lines changed- nova
- api/openstack/compute
- tests/unit/api/openstack/compute
2 files changed
+20
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
274 | 289 | | |
275 | 290 | | |
276 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 715 | + | |
720 | 716 | | |
721 | 717 | | |
722 | 718 | | |
| |||
0 commit comments