loggerhead.apps.config clobbers BranchWSGIApp.branch_url method

Bug #375948 reported by Matt Nordhoff
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
loggerhead
Fix Released
Critical
Matt Nordhoff

Bug Description

(Thanks to Spaz in #bzr for noticing this.)

From loggerhead.apps.config:

Project._add_view builds up a dict in self.view_data_by_name[view_name], including one key called "branch_url", which points to a string. Later, Project.view_named creates a BranchWSGIApp object and sets the contents of the dict as attributes on the BranchWSGIApp object. This means that the branch_url method is now a string, so BranchWSGIApp.app explodes when it attempts to call it.

See a traceback at http://pastebin.ca/1421449

This bug isn't new, but branch_url wasn't used anywhere until r335 of the trunk, so it wasn't noticed. Now start-loggerhead is broken. Whoops. :\

I'm not sure what the best solution is. I don't know the start-loggerhead-related code. The simplest solution is renaming the method to "public_branch_url" or something, but setting a bunch of attributes on another object seems bizarre. (Like I said, I don't know the code, so it might actually make sense.)

Changed in loggerhead:
importance: Undecided → Critical
status: New → Confirmed
description: updated
Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

On a semi-related note, self.view_data_by_name[view_name]['args'] says BranchWSGIApp's friendly_name argument should be view_name, but then it sets the friendly_name attribute to friendly_name.

Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

I've renamed BranchWSGIApp.branch_url to public_branch_url in r343; it works around this bug and I think it's a better name anyway (albeit a bit long...).

Revision history for this message
Matt Nordhoff (mnordhoff) wrote :

I'll mark this as fixed now that the immediate problem is solved, but I think the loggerhead.apps.config code could be improved and I'd like to discuss it with somebody.

Changed in loggerhead:
assignee: nobody → Matt Nordhoff (mnordhoff)
status: Confirmed → Fix Committed
Martin Albisetti (beuno)
Changed in loggerhead:
status: Fix Committed → Fix Released
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.