From c761a572ae14368ad002a911d07d14c5c5c1b703 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 14 Mar 2018 16:17:34 +0800 Subject: bugfix: TestAPI Cookie cannot be found Change-Id: Ibab60aba26e30669dddab74ce61ed00197dc86a8 Signed-off-by: SerenaFeng --- testapi/testapi-client/testapiclient/cli/pods.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'testapi/testapi-client/testapiclient/cli/pods.py') 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)) -- cgit 1.2.3-korg