diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-03-13 16:01:30 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-03-13 16:01:34 +0800 |
commit | d1ff9f9ffb01653a92e7ab2d43d5e9cb42fd806d (patch) | |
tree | f0261ce065761b2bd1c890a44de221291f514ab6 | |
parent | 526d3008a1b1ddf0c50cb1b59fcd1c2d2357d6c9 (diff) |
bugfix: query_by error
for pure pods get, the correct should be:
http://localhost:8000/api/v1/pods
now it is
http://localhost:8000/api/v1/pods?name=
Change-Id: I8fe080ddcf834d211cb1494087b70e5888a8b701
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
-rw-r--r-- | testapi/testapi-client/testapiclient/utils/url_parse.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testapi/testapi-client/testapiclient/utils/url_parse.py b/testapi/testapi-client/testapiclient/utils/url_parse.py index fbc503a..9f99a46 100644 --- a/testapi/testapi-client/testapiclient/utils/url_parse.py +++ b/testapi/testapi-client/testapiclient/utils/url_parse.py @@ -28,12 +28,12 @@ def get_queries(queries, parsed_args): return {query: getattr(parsed_args, query) for query in queries - if hasattr(parsed_args, query)} + if hasattr(parsed_args, query) and getattr(parsed_args, query)} def query_by(base, queries, parsed_args): - return query_join(base, - **get_queries(queries, parsed_args)) + qs = get_queries(queries, parsed_args) + return query_join(base, **qs) if qs else base def url_format(base, parsed_args): |