From 6d6069eae2fcdf66b31b166596509e195f2216d0 Mon Sep 17 00:00:00 2001 From: cindy oneill Date: Thu, 15 Oct 2015 10:09:36 -0600 Subject: [PATCH] X-Auth-Key should not be required in the header The monasca API does not do any keystone authentication so the keystone credentials should not be required in the header to the API. The HTTPClient has all the credential information upon initialization, and it uses that to get a new token when the keystone token expires. Change-Id: I62c909744ae6f9415457bfcfd23a01f47d379440 --- monascaclient/common/http.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/monascaclient/common/http.py b/monascaclient/common/http.py index 1640284..0e99ae5 100644 --- a/monascaclient/common/http.py +++ b/monascaclient/common/http.py @@ -234,15 +234,8 @@ class HTTPClient(object): self.log_http_response(resp) - if 'X-Auth-Key' not in kwargs['headers'] and \ - (resp.status_code == 401 or - (resp.status_code == 500 and "(HTTP 401)" in resp.content)): - raise exc.HTTPUnauthorized("Authentication failed. Please try" - " again with option " - "--include-password or export " - "MONASCA_INCLUDE_PASSWORD=1\n") - elif (resp.status_code == 401 or - (resp.status_code == 500 and "(HTTP 401)" in resp.content)): + if (resp.status_code == 401 or + (resp.status_code == 500 and "(HTTP 401)" in resp.content)): # re-authenticate and attempt one more request try: self.re_authenticate()