From f7d391e5cbb4c46eb8cb090ee3b6d03eb472f666 Mon Sep 17 00:00:00 2001 From: Bill Arnold <barnold@us.ibm.com> Date: Thu, 21 Aug 2014 10:18:36 -0400 Subject: [PATCH] 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 --- cinderclient/client.py | 2 +- cinderclient/tests/test_http.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cinderclient/client.py b/cinderclient/client.py index a436841cc..b4ebdb6a9 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -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 diff --git a/cinderclient/tests/test_http.py b/cinderclient/tests/test_http.py index f0121ea94..e362dd366 100644 --- a/cinderclient/tests/test_http.py +++ b/cinderclient/tests/test_http.py @@ -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()