Skip to content

Commit

Permalink
python3 compat fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Oct 20, 2024
1 parent 6c525a6 commit 3ee1a83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion st2auth_keystone_backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from keystone import KeystoneAuthenticationBackend
from .keystone import KeystoneAuthenticationBackend

__all__ = [
'KeystoneAuthenticationBackend'
Expand Down
4 changes: 2 additions & 2 deletions st2auth_keystone_backend/keystone.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

import logging
import httplib
import http.client

import requests

Expand Down Expand Up @@ -65,7 +65,7 @@ def authenticate(self, username, password):
LOG.debug('Authentication for user "{}" failed: {}'.format(username, str(e)))
return False

if login.status_code in [httplib.OK, httplib.CREATED]:
if login.status_code in [http.client.OK, http.client.CREATED]:
LOG.debug('Authentication for user "{}" successful'.format(username))
return True
else:
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_keystone_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

import sys
import httplib
import http.client

import unittest
import mock
Expand All @@ -26,9 +26,9 @@
class KeystoneAuthenticationBackendTestCase(unittest.TestCase):
def _mock_keystone(self, *args, **kwargs):
return_codes = {
'goodv2': httplib.OK,
'goodv3': httplib.CREATED,
'bad': httplib.UNAUTHORIZED
'goodv2': http.client.OK,
'goodv3': http.client.CREATED,
'bad': http.client.UNAUTHORIZED
}
json = kwargs.get('json')
res = Response()
Expand Down

0 comments on commit 3ee1a83

Please sign in to comment.