summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmrith Kumar <amrith@tesora.com>2016-03-28 16:10:53 -0400
committerAmrith Kumar <amrith@tesora.com>2016-03-30 06:49:27 -0400
commita571e449178a5b3dbab75129c12175e3aaeb0a09 (patch)
treeab9614ba0d553fa252b5cab0a421f00bca56a105
parent76f47ca58e70b15cfae6574a8e55ad950686fe83 (diff)
downloadtrove-a571e449178a5b3dbab75129c12175e3aaeb0a09.tar.gz
Address change in Route v2.3
Routes v2.3 which just came out included a change (see the LP bug referenced below) that caused py27 to fail. At issue is that Routes<2.3 allowed both submapper.connect(route_name, route_path), and submapper.connect(route_path). In 2.3, you were required to provide both route_name and route_path. This change adds a route_name to support both Routes < 2.3 and Routes == 2.3. Change-Id: I8738d4dcac2cc37b727767ba614fab4339758e22 Closes-Bug: 1563028 (cherry picked from commit 6664fb27af2218c411230f91b8e23e72845cbf2a)
-rw-r--r--trove/common/extensions.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/trove/common/extensions.py b/trove/common/extensions.py
index bdd469e9..a822946d 100644
--- a/trove/common/extensions.py
+++ b/trove/common/extensions.py
@@ -318,8 +318,9 @@ class ExtensionMiddleware(wsgi.Middleware):
action=action,
path_prefix=path_prefix,
conditions=conditions) as submap:
- submap.connect(path)
- submap.connect("%s.:(format)" % path)
+ submap.connect(path_prefix + path, path)
+ submap.connect(path_prefix + path + "_format",
+ "%s.:(format)" % path)
@webob.dec.wsgify(RequestClass=wsgi.Request)
def __call__(self, req):