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
This commit is contained in:
Bill Arnold 2014-08-21 10:18:36 -04:00 committed by William C. Arnold
parent 9bd8c5dff9
commit f7d391e5cb
2 changed files with 5 additions and 1 deletions

View File

@ -159,7 +159,7 @@ class HTTPClient(object):
if not auth_url:
raise exceptions.EndpointNotFound()
self.auth_url = auth_url.rstrip('/')
self.auth_url = auth_url.rstrip('/') if auth_url else None
self.version = 'v1'
self.region_name = region_name
self.endpoint_type = endpoint_type

View File

@ -198,6 +198,10 @@ class ClientTest(utils.TestCase):
test_get_call()
self.assertEqual([], self.requests)
def test_get_no_auth_url(self):
client.HTTPClient("username", "password",
"project_id", retries=0)
def test_post(self):
cl = get_authed_client()