summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlake Covarrubias <blake@platform9.com>2016-11-06 21:13:00 -0800
committerKaustubh Phatak <kphatak@platform9.com>2017-06-09 16:25:57 -0700
commitb38b97f446b626216cf0d7644256d4dbb764134d (patch)
tree78b3c1f46212494c08ae914f996f2af6ce8ff6f1
parent0ebba1b5100ed707ecc39007315f122f69179ed3 (diff)
Make slashes optional on tenant & instances routes
Notes
Notes (review): Code-Review+2: Kaustubh Phatak <kphatak@platform9.com> Workflow+1: Kaustubh Phatak <kphatak@platform9.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 09 Jun 2017 23:26:33 +0000 Reviewed-on: https://review.openstack.org/472864 Project: openstack/mors Branch: refs/heads/master
-rw-r--r--mors/mors_wsgi.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/mors/mors_wsgi.py b/mors/mors_wsgi.py
index 75bcd20..123ecd8 100644
--- a/mors/mors_wsgi.py
+++ b/mors/mors_wsgi.py
@@ -43,8 +43,7 @@ app.json_encoder = CustomJSONEncoder
43lease_manager = None 43lease_manager = None
44 44
45@enforce(required=['admin']) 45@enforce(required=['admin'])
46@app.route("/v1/tenant", methods=['GET']) 46@app.route("/v1/tenant/", methods=['GET'], strict_slashes=False)
47@app.route("/v1/tenant/", methods=['GET'])
48@error_handler 47@error_handler
49def get_all_tenants(): 48def get_all_tenants():
50 all_tenants = lease_manager.get_tenant_leases(get_context()) 49 all_tenants = lease_manager.get_tenant_leases(get_context())
@@ -81,10 +80,10 @@ def delete_tenant_lease(tenant_id):
81 lease_manager.delete_tenant_lease(get_context(), tenant_id) 80 lease_manager.delete_tenant_lease(get_context(), tenant_id)
82 return jsonify({'success': True}), 200, {'ContentType': 'application/json'} 81 return jsonify({'success': True}), 200, {'ContentType': 'application/json'}
83 82
84#-- Instnace - tenant related 83#-- Instance - tenant related
85 84
86@enforce(required=['_member_']) 85@enforce(required=['_member_'])
87@app.route("/v1/tenant/<tenant_id>/instances/", methods=['GET']) 86@app.route("/v1/tenant/<tenant_id>/instances/", methods=['GET'], strict_slashes=False)
88@error_handler 87@error_handler
89def get_tenant_and_instances(tenant_id): 88def get_tenant_and_instances(tenant_id):
90 instances = lease_manager.get_tenant_and_associated_instance_leases(get_context(), tenant_id) 89 instances = lease_manager.get_tenant_and_associated_instance_leases(get_context(), tenant_id)