The way in which this check counted compute nodes was
broken because of an incorrect for/else condition. If
the check is run with a nova.conf like we have in
devstack, where the API database is configured but
the [database]/connection is pointing at cell0, where
there are no compute nodes, the check passes saying
there are no compute nodes even if the are compute
nodes found in the cell databases (in the for loop).
This is because the else executes because the for loop
doesn't break, and then _count_compute_nodes returns 0
for cell0 and overwrites the num_computes variable.
This fixes the issue by checking if we have cell mappings
before running the loop, else we hit the else block as
was originally intended.
Conflicts: nova/cmd/status.py
NOTE(mriedem): The conflict is due to not having change
I35206e665f2c81531a2269dd66f8c5c0df834245 in Ocata.
Change-Id: I1a706d028a9ca894348a19b7b3df1ea673e4ec90
Partial-Bug: #1790721
(cherry picked from commit dcd421ae9e6f0391fea06c9d20949267354c3b3c)
(cherry picked from commit f588a0b6c337368596bc8732141e864f56f72212)
(cherry picked from commit 6a806de71b945509c8c5d3de53ff7ba5aa75bf87)
(cherry picked from commit 3f562226112b99d2044dd05a2e15b9752d5c9c1d)
Reviewed: https:/ /review. openstack. org/600119 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=ff8cb33283b bce474426f20f21 675ecc1449b4d7
Committed: https:/
Submitter: Zuul
Branch: stable/ocata
commit ff8cb33283bbce4 74426f20f21675e cc1449b4d7
Author: Matt Riedemann <email address hidden>
Date: Tue Sep 4 20:57:33 2018 -0400
Fix nova-status "_check_ resource_ providers" check
The way in which this check counted compute nodes was /connection is pointing at cell0, where compute_ nodes returns 0
broken because of an incorrect for/else condition. If
the check is run with a nova.conf like we have in
devstack, where the API database is configured but
the [database]
there are no compute nodes, the check passes saying
there are no compute nodes even if the are compute
nodes found in the cell databases (in the for loop).
This is because the else executes because the for loop
doesn't break, and then _count_
for cell0 and overwrites the num_computes variable.
This fixes the issue by checking if we have cell mappings
before running the loop, else we hit the else block as
was originally intended.
Conflicts:
nova/ cmd/status. py
NOTE(mriedem): The conflict is due to not having change 2c81531a2269dd6 6f8c5c0df834245 in Ocata.
I35206e665f
Change-Id: I1a706d028a9ca8 94348a19b7b3df1 ea673e4ec90 1fea06c9d209492 67354c3b3c) 596bc8732141e86 4f56f72212) 9c8c5d3de53ff7b a5aa75bf87) 2044dd05a2e15b9 752d5c9c1d)
Partial-Bug: #1790721
(cherry picked from commit dcd421ae9e6f039
(cherry picked from commit f588a0b6c337368
(cherry picked from commit 6a806de71b94550
(cherry picked from commit 3f562226112b99d