When no defined flavors, check will return a status code CRITICAL with message "Unable to contact nova API"

Bug #1784650 reported by Nagasai Vinaykumar Kapalavai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Operators
Undecided
Nagasai Vinaykumar Kapalavai

Bug Description

Description of problem:

If current platform has no defined flavors, check will return a status code CRITICAL with this message "Unable to contact nova API."

In python script we can note this :
    def flavors_list():
        try:
            return list(client.flavors.list())
        except Exception as ex:
            utils.critical(str(ex))

    elapsed, flavors = utils.timeit(flavors_list)
    if not flavors:
        utils.critical("Unable to contact nova API.")

Script check a list of flavors and if not it will return a CRITICAL error.

But the script doesn't check if API status is OK : we can have no flavors in our environment and when trying to contact flavors API it returns an ERROR

Version-Release number of selected component (if applicable):

How reproducible:
Always

Steps to Reproduce:
1. Run script when there are no flavors

Actual results:
status code CRITICAL with this message "Unable to contact nova API."

Expected results:
No error

Additional info:

Changed in osops:
assignee: nobody → Nagasai Vinaykumar Kapalavai (vinaykns2)
Changed in osops:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to osops-tools-monitoring (master)

Reviewed: https://review.openstack.org/584464
Committed: https://git.openstack.org/cgit/openstack/osops-tools-monitoring/commit/?id=a2ff2ebf0218dd0d1dd72ce1fc71e22576890ef2
Submitter: Zuul
Branch: master

commit a2ff2ebf0218dd0d1dd72ce1fc71e22576890ef2
Author: Nagasai Vinaykumar Kapalavai <email address hidden>
Date: Tue Jul 31 11:13:26 2018 -0400

    Fixes for Some oschecks

    Currently, (Ceilometer, cinder and nova) checks will throw an error if
    result is empty (for ex: nova flavor list) even though the api is working.
    With the proposed fix it will just look for the api response and
    doesn't matter about the result indeed.

    Change-Id: Ib27d2856fa0f0c794e9ebb348cb84d3d839adffe
    Closes-Bug: #1784650

Changed in osops:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers