Misconfiguration of OPENSTACK_API_VERSIONS is hard to debug

Bug #1411427 reported by Gabriel Hurley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Gabriel Hurley

Bug Description

In local_settings.py we allow operators to specify the preferred API versions for their service endpoints. The values provided are then fed directly into a dict key lookup in the APIVersionManager code. Any misconfiguration here results in a KeyError which provides no guidance as to what an acceptable value might be.

Instead, we can:

1. Verify that the value provided is of the right type (currently all version keys are ints or floats, not strings as one might expect).

2. Provide a list of the keys which would be acceptable if an invalid key is provided.

3. Raise a useful and explanatory exception if these values are incorrect.

As a correlated issue, it also turns out that the way the metadata_defs panel checks for the Glance active version triggers an error since Glance (and other APIs for which only one version is supported) don't actually bother to declare their supported versions.

Changed in horizon:
assignee: nobody → Gabriel Hurley (gabriel-hurley)
milestone: none → kilo-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/147670

Changed in horizon:
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-2 → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/147670
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=59ad632a68074eefcc675e60391dd630a8cfcad1
Submitter: Jenkins
Branch: master

commit 59ad632a68074eefcc675e60391dd630a8cfcad1
Author: Gabriel Hurley <email address hidden>
Date: Thu Jan 15 13:39:26 2015 -0800

    Quality of life improvements to APIVersionManager

    * Verifies that the API version values provided are of the right type
      (currently all version keys are ints or floats, not strings).

    * Provides a list of the version keys which would be acceptable if an
      invalid version is provided.

    * Raises a useful and explanatory exception if these values are
      incorrect.

    * Adds the "preferred" API version to the "supported" versions as
      a convenience during init.

    Change-Id: I0bc75b145bba757ff6cd405e1a654aeef296f2df
    Closes-Bug: 1411427

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-3 → 2015.1.0
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.