diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-03-14 16:17:34 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2018-03-14 16:17:34 +0800 |
commit | c761a572ae14368ad002a911d07d14c5c5c1b703 (patch) | |
tree | 67b7fc1d45540f869f955c63e6a097443e2b97c3 /testapi/testapi-client/testapiclient/cli/pods.py | |
parent | 0e0e2702eeeb824f57599c536ae1534c5b0668f7 (diff) |
bugfix: TestAPI Cookie cannot be found
Change-Id: Ibab60aba26e30669dddab74ce61ed00197dc86a8
Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/testapi-client/testapiclient/cli/pods.py')
-rw-r--r-- | testapi/testapi-client/testapiclient/cli/pods.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/testapi/testapi-client/testapiclient/cli/pods.py b/testapi/testapi-client/testapiclient/cli/pods.py index 9cadee7..8d0970b 100644 --- a/testapi/testapi-client/testapiclient/cli/pods.py +++ b/testapi/testapi-client/testapiclient/cli/pods.py @@ -1,17 +1,15 @@ import json from testapiclient.utils import command -from testapiclient.utils import http_client as client -from testapiclient.utils import identity -from testapiclient.utils import url_parse as up +from testapiclient.utils import urlparse def pods_url(): - return up.resource_join('pods') + return urlparse.resource_join('pods') def pod_url(parsed_args): - return up.path_join(pods_url(), parsed_args.name) + return urlparse.path_join(pods_url(), parsed_args.name) class PodGet(command.Lister): @@ -34,7 +32,8 @@ class PodGet(command.Lister): "creation_date", ) - data = client.get(up.query_by(pods_url(), 'name', parsed_args)) + data = self.app.client_manager.get( + urlparse.query_by(pods_url(), 'name', parsed_args)) return self.format_output(columns, data.get('pods', [])) @@ -49,7 +48,8 @@ class PodGetOne(command.ShowOne): return parser def take_action(self, parsed_args): - return self.format_output(client.get(pod_url(parsed_args))) + return self.format_output( + self.app.client_manager.get(pod_url(parsed_args))) class PodCreate(command.ShowOne): @@ -66,9 +66,9 @@ class PodCreate(command.ShowOne): 'mode should be either "metal" or "virtual.') return parser - @identity.authenticate def take_action(self, parsed_args): - return self.format_output(client.post(pods_url(), parsed_args.pod)) + return self.format_output( + self.app.client_manager.post(pods_url(), parsed_args.pod)) class PodDelete(command.Command): @@ -81,6 +81,5 @@ class PodDelete(command.Command): help='Delete pods using name') return parser - @identity.authenticate def take_action(self, parsed_args): - return client.delete(pod_url(parsed_args)) + return self.app.client_manager.delete(pod_url(parsed_args)) |