Change in ovirt-engine-sdk[sdk_3.4]: sdk: Remove trailing slashes from URL prefix

juan.hernandez at redhat.com juan.hernandez at redhat.com
Tue Feb 11 11:51:35 UTC 2014


Juan Hernandez has submitted this change and it was merged.

Change subject: sdk: Remove trailing slashes from URL prefix
......................................................................


sdk: Remove trailing slashes from URL prefix

Currently we get the URL prefix of the RESTAPI from the URL provided by
the user, without modification. If this prefix contains trailing slashes we
end up building complete URLs that contain two slashes. For example, if
the user writes this code:

  api = ovirtsdk.api.API(url='https://whatever/api/', ...)
  api.clusters.list()

We send the following request to the server:

  GET /api//clusters HTTP/1.1

The server doesn't accept these two slashes and generates an error
response.

To fix this issue this patch removes trailing slashes from the URL
prefix.

Change-Id: I7a75aeccd7ba42fa3d49c4cebb9fc0ab3eff5cb9
Bug-Url: https://bugzilla.redhat.com/1063746
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
(cherry picked from commit 61ac75bc23f8aa9346ab774ee272894fb8259595)
---
M src/codegen/templates/entrypointtemplate
M src/ovirtsdk/api.py
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Juan Hernandez: Verified; Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/24317
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a75aeccd7ba42fa3d49c4cebb9fc0ab3eff5cb9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: sdk_3.4
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>



More information about the Engine-commits mailing list