StopIteration causes check_nova_services to finish abruptly

Bug #1802303 reported by Alvaro Uria
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
charm-openstack-service-checks
Won't Fix
Medium
Unassigned

Bug Description

root@juju-3d3206-0-lxd-5:~# sudo -u nagios /usr/local/lib/nagios/plugins/check_nova_services.py
<function check_nova_services at 0x7f2c9a791848> raised unknown exception '<type 'exceptions.StopIteration'>'
============================================================
Traceback (most recent call last):
  File "/usr/local/lib/nagios/plugins/nagios_plugin.py", line 32, in try_check
    function(*args, **kwargs)
  File "/usr/local/lib/nagios/plugins/check_nova_services.py", line 66, in check_nova_services
    services_compute))
  File "/usr/local/lib/nagios/plugins/check_nova_services.py", line 21, in check_hosts_up
    host_svc = (svc for svc in services_compute if svc['host'] ==
StopIteration
============================================================

Expectation:
Iteration should be caught and issue a "continue" statement.
https://git.launchpad.net/charm-openstack-service-checks/tree/files/plugins/check_nova_services.py#n21

try:
  ...
except StopIteration as e:
  continue

Alternatively, and since a single item is expected, a list could be created (no expectation of mem exhaustion for lazy load).

Revision history for this message
Zachary Zehring (zzehring) wrote :

Encountered this error as well. For my case, if no services (svc) is returned by list comprehension, the error is thrown. This is occurring when there's a host in a host aggregate but no corresponding OS service running on it.

Xav Paice (xavpaice)
Changed in charm-openstack-service-checks:
status: New → Triaged
importance: Undecided → Medium
Eric Chen (eric-chen)
Changed in charm-openstack-service-checks:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.