Merge "Api_version_request.matches does not accept a string or None"

This commit is contained in:
Jenkins 2016-03-03 10:57:23 +00:00 committed by Gerrit Code Review
commit c62159d0bf

View File

@ -281,9 +281,14 @@ used to modify behavior based on its value::
<common code> <common code>
req_version = req.api_version_request req_version = req.api_version_request
if req_version.matches("2.1", "2.5"): req1_min = api_version_request.APIVersionRequest("2.1")
req1_max = api_version_request.APIVersionRequest("2.5")
req2_min = api_version_request.APIVersionRequest("2.6")
req2_max = api_version_request.APIVersionRequest("2.10")
if req_version.matches(req1_min, req1_max):
....stuff.... ....stuff....
elif req_version.matches("2.6", "2.10"): elif req_version.matches(req2min, req2_max):
....other stuff.... ....other stuff....
elif req_version > api_version_request.APIVersionRequest("2.10"): elif req_version > api_version_request.APIVersionRequest("2.10"):
....more stuff..... ....more stuff.....