Ensure getCapacityState() is not called for hosts in maintenance#8025
Ensure getCapacityState() is not called for hosts in maintenance#8025DaanHoogland merged 1 commit intoapache:4.18from
Conversation
When a host is in maintenance, the relevant rows are removed from the op_host_capacity table. In this case, getCapacityState() triggers a nullpointer exception.
DaanHoogland
left a comment
There was a problem hiding this comment.
code looks good. I think some refactorring could make it more readable, like adding methods for the empty host and the actuall data adding.
|
@blueorangutan package |
|
@DaanHoogland a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7186 |
Codecov Report
@@ Coverage Diff @@
## 4.18 #8025 +/- ##
=========================================
Coverage 13.06% 13.07%
- Complexity 9106 9107 +1
=========================================
Files 2720 2720
Lines 257506 257517 +11
Branches 40149 40152 +3
=========================================
+ Hits 33649 33658 +9
- Misses 219627 219628 +1
- Partials 4230 4231 +1
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@blueorangutan test |
|
@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
@benj-n can you add test-information? |
|
@blueorangutan test |
|
@rohityadavcloud a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-7834)
|
Description
This PR ensures getCapacityState() is not called for hosts in maintenance.
When a host is in maintenance, the relevant rows are removed from the op_host_capacity table. In this case, getCapacityState() triggers a nullpointer exception.
Fixes: #8024
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?