From f2129eaeec42288dda03d36811a5292384f1b2e3 Mon Sep 17 00:00:00 2001 From: Alexander Ignatov Date: Fri, 31 Jan 2014 16:45:52 +0400 Subject: [PATCH] Fixed issue when savanna url is not provided * Now savannaclient takes savanna_url is as follows: https://HOST:PORT/VERSION/PROJECT_ID IMPORTANT! This URL pattern and only this is valid for client now. * Old URL pattern 'https://HOST:PORT/VERSION' is no longer valid and exception will be rised on attempt to connect to 'data_processing' service * Why this needed, because it's common OS approach: - base.url_for(ctx.service_catalog, 'data_processing') returns https://HOST:PORT/VERSION/PROJECT_ID - This bug blocks impl of bp savanna-as-heat-resource - Here we recieve https://HOST:PORT/VERSION/PROJECT_ID https://github.com/openstack/python-savannaclient/blob/master/savannaclient/api/client.py#L60 Change-Id: Iba98d2a57c0aa7900e3b4ec8bbc69b198e933db4 Closes-Bug: #1274913 --- savannaclient/api/client.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/savannaclient/api/client.py b/savannaclient/api/client.py index 1a3abf11..9e5f8630 100644 --- a/savannaclient/api/client.py +++ b/savannaclient/api/client.py @@ -62,20 +62,8 @@ class Client(object): if not savanna_catalog_url: raise RuntimeError("Could not find Savanna endpoint in catalog") - if not project_id: - keystone = self.get_keystone_client(username=username, - api_key=api_key, - auth_url=auth_url, - token=input_auth_token, - project_name=project_name) - project_id = self.get_projects_list(keystone).find( - name=project_name).id - if not project_id: - raise RuntimeError("Could not determine tenant id") - - savanna_url = savanna_catalog_url + "/" + project_id - - self.client = httpclient.HTTPClient(savanna_url, input_auth_token) + self.client = httpclient.HTTPClient(savanna_catalog_url, + input_auth_token) self.clusters = clusters.ClusterManager(self) self.cluster_templates = cluster_templates.ClusterTemplateManager(self)