client HTTPClient __init__ fails if auth_url None

Bug #1358926 reported by William C. Arnold
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
William C. Arnold

Bug Description

Specifically,
        self.auth_url = auth_url.rstrip('/')
probably should be (like in some other clients, e.g. nova and neutron)
       self.auth_url = auth_url.rstrip('/') if auth_url else auth_url

The failing code is a problem when an auth tokem is requested from a trust; e.g. this can happen in openstack heat for nested stacks of stacks.

failure looks like the following (to aid people who search on tracebacks):
Traceback (most recent call last):
  File "/opt/stack/heat/heat/engine/resources/volume.py", line 366, in __call__
    vol = self.clients.cinder().volumes.get(nova_vol.id)
  File "/opt/stack/heat/heat/engine/clients.py", line 189, in cinder
    self._clients['cinder'] = cinderclient.Client('1', **args)
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 571, in Client
    return client_class(*args, **kwargs)
  File "/opt/stack/python-cinderclient/cinderclient/v1/client.py", line 103, in __init__
    session=session)
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 550, in _construct_http_client
    auth_plugin=auth_plugin,
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 187, in __init__
    self.auth_url = auth_url.rstrip('/')
AttributeError: 'NoneType' object has no attribute 'rstrip'

Revision history for this message
William C. Arnold (barnold-8) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/115758

Changed in python-cinderclient:
assignee: nobody → William C. Arnold (barnold-8)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-cinderclient (master)

Reviewed: https://review.openstack.org/115758
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=f7d391e5cbb4c46eb8cb090ee3b6d03eb472f666
Submitter: Jenkins
Branch: master

commit f7d391e5cbb4c46eb8cb090ee3b6d03eb472f666
Author: Bill Arnold <email address hidden>
Date: Thu Aug 21 10:18:36 2014 -0400

    client HTTPClient __init__ fails if auth_url None

    The initializer for the python-cinderclient HTTPClient class
    fails if passed a None for an auth_url.
    This patch modifies the inializer to not call rstrip
    if auth_url is None, matching the initalizers in
    python-novaclient and python-neutronclient

    Change-Id: I19dd6911816639a0e0d6175ba910e9777a4b5981
    Closes-bug: #1358926

Changed in python-cinderclient:
status: In Progress → Fix Committed
Changed in python-cinderclient:
milestone: none → 1.3.1
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.