Remove version from href, incorrect RE

Bug #810149 reported by Alex Meade
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Stephanie Reese

Bug Description

in nova/api/openstack/common.py

the remove_version_from_href function currently uses the RE:

new_href = re.sub(r'[/][v][0-9]*.[0-9]*', '', href)

this incorrectly handles any href with a "/v" in it
it should be:

new_href = re.sub(r'[/][v][0-9]+\.[0-9]+[/]', '/', href)
or
new_href = re.sub(r'[/][v][0-9]+\.[0-9]+', '', href)
depending if the href ends in '/'

Related branches

Changed in nova:
assignee: nobody → Stephanie Reese (reese-sm)
Changed in nova:
status: New → In Progress
Revision history for this message
Stephanie Reese (reese-sm) wrote :

If a version appears more than once in the href (would that ever happen?), I'm assuming this function should remove only the first occurrence. Please let me know if that's not the case.

Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-3
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-3 → 2011.3
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.