Client doesn't work when savanna_url param is not provided

Bug #1274913 reported by Alexander Ignatov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python client library for Sahara
Fix Released
Critical
Alexander Ignatov

Bug Description

The following code:
==========================
from savannaclient.api import client as savannaclient

args = {'service_type': 'data_processing',
             'project_id': OS_TENANT_ID,
             'input_auth_token': TOKEN,
             'auth_url': AUTH_URL
             }

client = savannaclient.Client(**args)
print client.node_group_templates.list()
=============================

fails with exception:
savannaclient.api.base.APIException: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

This is because of the following line of code:
https://github.com/openstack/python-savannaclient/blob/master/savannaclient/api/client.py#L76

There is doubled '/' + 'project_id' in our case because keystone before returns savanna_catalog_url which already contain '/' + 'project_id'

Changed in python-savannaclient:
milestone: none → next
Changed in python-savannaclient:
assignee: nobody → Alexander Ignatov (aignatov)
status: Confirmed → In Progress
Changed in python-savannaclient:
milestone: next → 0.4.2
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-savannaclient (master)

Reviewed: https://review.openstack.org/70340
Committed: https://git.openstack.org/cgit/openstack/python-savannaclient/commit/?id=f2129eaeec42288dda03d36811a5292384f1b2e3
Submitter: Jenkins
Branch: master

commit f2129eaeec42288dda03d36811a5292384f1b2e3
Author: Alexander Ignatov <email address hidden>
Date: Fri Jan 31 16:45:52 2014 +0400

    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

Changed in python-savannaclient:
status: In Progress → Fix Committed
Changed in python-savannaclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.