Commit 179dfbf
committed
<fix>[kvm]: prevent metadata deletion when DVD returns empty
When hypervisor metadata collection from DVD returns an empty
list, the existing metadata was deleted before the empty check,
causing all hosts to lose their hypervisor version metadata and
matchState to become Unknown.
1. Why is this change necessary?
saveHostOsCategoryList first deleted all existing metadata for
the management node, then checked if the input was empty. When
DVD collection returned empty, this wiped all metadata, causing
matchTargetVersion to be null and matchState to become Unknown.
2. How does it address the problem?
Move the empty-list check before the delete operation so that
an empty input preserves existing metadata. A warning is logged
to indicate the skip.
3. Are there any side effects?
None. Non-empty input behavior is unchanged.
# Summary of changes (by module):
- kvm: move empty check before metadata delete in
KvmHypervisorInfoManagerImpl.saveHostOsCategoryList()
Related: ZSTAC-83682
Change-Id: I81f9baacac7fce9af2363a0ce5c960532d3838901 parent 933931f commit 179dfbf
1 file changed
Lines changed: 5 additions & 3 deletions
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
281 | 286 | | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
| |||
0 commit comments