diff --git a/tacker/glance_store/store.py b/tacker/glance_store/store.py index 10e10b0d1..4b234fe51 100644 --- a/tacker/glance_store/store.py +++ b/tacker/glance_store/store.py @@ -150,6 +150,6 @@ def _add_basic_auth(request, username, password): This function adds basic authentication information to a urllib request. """ - auth_str = base64.encodestring(('%s:%s' % ( + auth_str = base64.encodebytes(('%s:%s' % ( username, password)).encode()).decode().strip() request.add_header('Authorization', 'Basic %s' % auth_str) diff --git a/tox.ini b/tox.ini index fdab5b433..33ce79079 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38,py36,pep8,docs +envlist = py39,py38,py36,pep8,docs minversion = 3.1.1 skipsdist = True ignore_basepython_conflict = True @@ -40,6 +40,10 @@ commands = oslo_debug_helper {posargs} basepython = python3.6 commands = oslo_debug_helper {posargs} +[testenv:debug-py39] +basepython = python3.9 +commands = oslo_debug_helper {posargs} + [testenv:pep8] deps = -r{toxinidir}/doc/requirements.txt -r{toxinidir}/test-requirements.txt