Extension should define urls in urls.py file

Bug #1569244 reported by Sylwester Brzeczkowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Low
Fuel Sustaining

Bug Description

To reduce the mess in main extension file, we should move urls definitions (patterns + class) to urls.py

To do this we should introduce new method in BaseExtension class which will look for url patterns in 'urls.py' file and set the 'url' class variable.

The example of the mess: https://review.openstack.org/#/c/301945/16/nailgun/nailgun/extensions/network_manager/extension.py

Changed in fuel:
status: New → Confirmed
Revision history for this message
Evgeniy L (rustyrobot) wrote :

>> will look for url patterns in 'urls.py' file and set the 'url' class variable.

I would not implement this kind of magic and would leave it up to the developer, to import module and explicitly assign it to extension class urls parameter.

But I would be interested to see what other engineers think about it.

Revision history for this message
Ryan Moe (rmoe) wrote :

I think importing the patterns from another file and assigning them explicitly is a good solution. Another thing to consider would be unifying the pattern format. Currently the format used in the extensions is a little more verbose than that used in core.

Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
assignee: Fuel Python (Deprecated) (fuel-python) → Fuel Sustaining (fuel-sustaining-team)
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.