mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 12:39:22 -02:30
remove python2 support from awxkit
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
from datetime import datetime
|
||||
import json
|
||||
|
||||
import six
|
||||
|
||||
from awxkit.utils import poll_until
|
||||
from awxkit.exceptions import WaitUntilTimeout
|
||||
|
||||
@@ -50,7 +48,7 @@ class HasStatus(object):
|
||||
return self.wait_until_status(self.started_statuses, interval=interval, timeout=timeout)
|
||||
|
||||
def assert_status(self, status_list, msg=None):
|
||||
if isinstance(status_list, six.text_type):
|
||||
if isinstance(status_list, str):
|
||||
status_list = [status_list]
|
||||
if self.status in status_list:
|
||||
# include corner cases in is_successful logic
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
from six.moves import http_client as http
|
||||
import http.client as http
|
||||
|
||||
import awxkit.exceptions as exc
|
||||
from awxkit.api.mixins import DSAdapter, HasCopy, HasCreate
|
||||
@@ -19,10 +19,7 @@ from awxkit.utils import (
|
||||
from . import base, page
|
||||
from .page import exception_from_status_code
|
||||
|
||||
try:
|
||||
from urllib.parse import urljoin
|
||||
except ImportError:
|
||||
from urlparse import urljoin
|
||||
from urllib.parse import urljoin
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -4,8 +4,7 @@ import json
|
||||
import re
|
||||
|
||||
from requests import Response
|
||||
import six
|
||||
from six.moves import http_client as http
|
||||
import http.client as http
|
||||
|
||||
from awxkit.utils import (
|
||||
PseudoNamespace,
|
||||
@@ -170,10 +169,7 @@ class Page(object):
|
||||
def from_json(cls, raw):
|
||||
resp = Response()
|
||||
data = json.dumps(raw)
|
||||
if six.PY3:
|
||||
resp._content = bytes(data, 'utf-8')
|
||||
else:
|
||||
resp._content = data
|
||||
resp._content = bytes(data, 'utf-8')
|
||||
resp.encoding = 'utf-8'
|
||||
resp.status_code = 200
|
||||
return cls(r=resp)
|
||||
|
||||
Reference in New Issue
Block a user