diff --git a/keystoneclient/client.py b/keystoneclient/client.py index a29e34afa..0c2b9cd21 100644 --- a/keystoneclient/client.py +++ b/keystoneclient/client.py @@ -145,7 +145,6 @@ class HTTPClient(httplib2.Http): # Perform the request once. If we get a 401 back then it # might be because the auth token expired, so try to # re-authenticate and try again. If it still fails, bail. - print 'SENDING: %s' % kwargs try: resp, body = self.request(self.management_url + url, method, **kwargs) diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index 627634c38..c5e5545b9 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -85,21 +85,20 @@ class Client(client.HTTPClient): Returns ``True`` if authentication was successful. """ self.management_url = self.auth_url - # try: - raw_token = self.tokens.authenticate(username=self.username, - tenant_id=self.tenant_id, - tenant_name=self.tenant_name, - password=self.password, - return_raw=True) - print 'got token %s' % raw_token - self._extract_service_catalog(self.auth_url, raw_token) - return True - # except (exceptions.AuthorizationFailure, exceptions.Unauthorized): - # raise - # except Exception, e: - # _logger.exception("Authorization Failed.") - # raise exceptions.AuthorizationFailure("Authorization Failed: " - # "%s" % e) + try: + raw_token = self.tokens.authenticate(username=self.username, + tenant_id=self.tenant_id, + tenant_name=self.tenant_name, + password=self.password, + return_raw=True) + self._extract_service_catalog(self.auth_url, raw_token) + return True + except (exceptions.AuthorizationFailure, exceptions.Unauthorized): + raise + except Exception, e: + _logger.exception("Authorization Failed.") + raise exceptions.AuthorizationFailure("Authorization Failed: " + "%s" % e) def _extract_service_catalog(self, url, body): """ Set the client's service catalog from the response data. """ diff --git a/tests/v2_0/test_tenants.py b/tests/v2_0/test_tenants.py index 2b8751c5c..77aa94ce7 100644 --- a/tests/v2_0/test_tenants.py +++ b/tests/v2_0/test_tenants.py @@ -144,7 +144,6 @@ class TenantTests(utils.TestCase): req_body['tenant']['name'], req_body['tenant']['description'], req_body['tenant']['enabled']) - print tenant self.assertTrue(isinstance(tenant, tenants.Tenant)) self.assertEqual(tenant.id, 4) self.assertEqual(tenant.name, "tenantX")