Comment 1 for bug 1910788

Revision history for this message
Lance Bragstad (lbragstad) wrote :

I can recreate this using the following code:

╭─ubuntu@ubuntu20 ~
╰─➤ $ cat ksa.py 1 ↵
import os
import sys

from keystoneauth1 import session
from keystoneauth1.identity import v3

token = os.environ.get('TOKEN')
if not token:
    print('No token provided.')
    sys.exit(1)

a = v3.TokenMethod(token=token)
s = session.Session(auth=a)

print(s.get('http://192.168.1.150/identity/v3/'))

╭─ubuntu@ubuntu20 ~
╰─➤ $ python3 ksa.py
Traceback (most recent call last):
  File "ksa.py", line 15, in <module>
    print(s.get('http://192.168.1.150/identity/v3/'))
  File "/home/ubuntu/keystoneauth/keystoneauth1/session.py", line 1131, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/ubuntu/keystoneauth/keystoneauth1/session.py", line 780, in request
    auth_headers = self.get_auth_headers(auth)
  File "/home/ubuntu/keystoneauth/keystoneauth1/session.py", line 1191, in get_auth_headers
    return auth.get_headers(self, **kwargs)
AttributeError: 'TokenMethod' object has no attribute 'get_headers'

I'm using keystoneauth1 version 4.3.0