Merge lp:~milo/lava-tool/server-rpc-endpoint-fix into lp:~linaro-validation/lava-tool/trunk
Proposed by
Milo Casagrande
Status: | Merged |
---|---|
Merged at revision: | 191 |
Proposed branch: | lp:~milo/lava-tool/server-rpc-endpoint-fix |
Merge into: | lp:~linaro-validation/lava-tool/trunk |
Diff against target: |
98 lines (+21/-24) 3 files modified
lava/helper/command.py (+2/-2) lava_tool/tests/test_utils.py (+3/-3) lava_tool/utils.py (+16/-19) |
To merge this branch: | bzr merge lp:~milo/lava-tool/server-rpc-endpoint-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Antonio Terceiro | Approve | ||
Linaro Validation Team | Pending | ||
Review via email:
|
Description of the change
This merge proposal fixed the problem with how the server and rpc_endpoint parameters have been intended.
With these changes now "server" is just a name, and "rpc_endpoint" is the actual URL.
To post a comment you must log in.
> === modified file 'lava_tool/ utils.py' and_create_ url(server, endpoint=""): and_create_ url(endpoint) : urlparse( server) urlunparse( urlparse( endpoint) urlunparse(
> --- lava_tool/utils.py 2013-07-26 14:12:33 +0000
> +++ lava_tool/utils.py 2013-07-30 17:42:26 +0000
> @@ -281,7 +281,7 @@
> editor))
>
>
> -def verify_
> +def verify_
> """Checks that the provided values make a correct URL.
>
> If the server address does not contain a scheme, by default it will use
> @@ -291,25 +291,22 @@
> :param server: A server URL to verify.
> :return A URL.
> """
> - scheme, netloc, path, params, query, fragment = \
> - urlparse.
> - if not scheme:
> - scheme = "https"
> - if not netloc:
> - netloc, path = path, ""
> -
> - if not netloc[-1:] == "/":
> - netloc += "/"
> -
> + url = ""
> if endpoint:
> - if endpoint[0] == "/":
> - endpoint = endpoint[1:]
> - if not endpoint[-1:] == "/":
> - endpoint += "/"
> - netloc += endpoint
> -
> - return urlparse.
> - (scheme, netloc, path, params, query, fragment))
> + scheme, netloc, path, params, query, fragment = \
> + urlparse.
> + if not scheme:
> + scheme = "https"
> + if not netloc:
> + netloc, path = path, ""
> +
> + url = urlparse.
> + (scheme, netloc, path, params, query, fragment))
> +
> + if url[-1:] != "/":
> + url += "/"
> +
> + return url
I don't understand why you need to parse the url just to unparse it a
few lines below. This function seems rather pointless to me.