Having a relative path for api_extensions_path no longer seems to work

Bug #1301660 reported by Nikhil Manchanda
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Fix Released
Low
Shuichiro MAKIGAKI

Bug Description

Having api_extensions_path = trove/extensions/routes doesn't seem to work.
Giving it a full path still works.

Changed in trove:
importance: Undecided → Low
Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :

It took me ages to find that this was causing breakage. A typical symptom is:

$ trove list
+--------------------------------------+------+--------+-----------+------+
| id | name | status | flavor_id | size |
+--------------------------------------+------+--------+-----------+------+
| 5c1e2f20-6078-49cd-bc90-0d5a8847b6ce | db0 | ACTIVE | 2 | 2 |
+--------------------------------------+------+--------+-----------+------+

$ trove database-list 5c1e2f20-6078-49cd-bc90-0d5a8847b6ce
ERROR: The resource could not be found.

i.e spome api calls failing. The cause being (of course) that no extensions have loaded.

Revision history for this message
Mark Kirkwood (mark-kirkwood) wrote :

I wonder if making the extension manager complain a little in this situation might be good:

Revision history for this message
Shuichiro MAKIGAKI (shuichiro-makigaki) wrote :

A simple way is to add LOG.error() as Mark says. For example, Neutron just shows an error if the path doesn't exists:
https://github.com/openstack/neutron/blob/master/neutron/api/extensions.py#L529

It's reasonable that trove/extensions/routes is treated as <trove top directory>/trove/extensions/routes. From the view of extensions.py, this means ../../trove/extensions/routes.

Anyway, adding LOG.error() is required for user friendly IMO. I'd like to take over and fix this if anyone doesn't do.

Revision history for this message
Shuichiro MAKIGAKI (shuichiro-makigaki) wrote :

Ah, sorry, I should make my opinion clear: in current Trove, relative path for
api_extensions_path seems to work. I can't reproduce this bug on current
master branch. So, this bug may be fixed.

However, before closing this ticket, I'd like to suggest attached patch.

In the patch, I removed following changes from Mark's patch because
similar messages appered in _load_all_extensions_from_path():
if os.path.exists(self.path):
    LOG.debug(_('Loading extensions from %s'), self.path)

If you have a chance it would be great to hear any feedback.

Changed in trove:
assignee: nobody → Shuichiro MAKIGAKI (shuichiro-makigaki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

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

Changed in trove:
status: New → In Progress
Changed in trove:
milestone: none → juno-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to trove (master)

Reviewed: https://review.openstack.org/99001
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=5f9e1fa1542b130a775874bea32f0dbf4963fd9a
Submitter: Jenkins
Branch: master

commit 5f9e1fa1542b130a775874bea32f0dbf4963fd9a
Author: Shuichiro MAKIGAKI <email address hidden>
Date: Tue Jun 10 19:10:49 2014 +0900

    Add warnings when a path for api_extensions_path does not exist

    This commit fixes api-paste factory to show warnings when the path
    for api_extensions_path doesn't exist.

    Change-Id: I2288e39d6740aabc7818c3c963257e700237afe5
    Closes-Bug: #1301660

Changed in trove:
status: In Progress → Fix Committed
Changed in trove:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in trove:
milestone: juno-2 → 2014.2
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.