Drop six support
This update is to drop all of six support to move Closes-bug: #1900389 Change-Id: Ia6c61751203e98d432344dc9a52fe65bdb062af0 Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
This commit is contained in:
parent
727493c7bf
commit
754f6df5a7
@ -48,7 +48,6 @@ requests-mock==1.2.0
|
||||
requestsexceptions==1.2.0
|
||||
rfc3986==0.3.1
|
||||
simplejson==3.5.1
|
||||
six==1.10.0
|
||||
stestr==2.0.0
|
||||
stevedore==1.20.0
|
||||
testtools==2.2.0
|
||||
|
@ -8,7 +8,6 @@ netaddr>=0.7.18 # BSD
|
||||
requests>=2.14.2 # Apache-2.0
|
||||
python-keystoneclient>=3.8.0 # Apache-2.0
|
||||
simplejson>=3.5.1 # MIT
|
||||
six>=1.10.0 # MIT
|
||||
stevedore>=1.20.0 # Apache-2.0
|
||||
Babel!=2.4.0,>=2.3.4 # BSD
|
||||
oslo.i18n>=3.15.3 # Apache-2.0
|
||||
|
@ -28,7 +28,6 @@ ATOM_LINK_NOTATION = "{%s}link" % ATOM_NAMESPACE
|
||||
|
||||
TYPE_BOOL = "bool"
|
||||
TYPE_INT = "int"
|
||||
TYPE_LONG = "long"
|
||||
TYPE_FLOAT = "float"
|
||||
TYPE_LIST = "list"
|
||||
TYPE_DICT = "dict"
|
||||
|
@ -18,7 +18,6 @@ from xml.etree import ElementTree as etree
|
||||
from xml.parsers import expat
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from tackerclient.common import constants
|
||||
from tackerclient.common import exceptions as exception
|
||||
@ -26,9 +25,6 @@ from tackerclient.i18n import _
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
if six.PY3:
|
||||
long = int
|
||||
|
||||
|
||||
class ActionDispatcher(object):
|
||||
"""Maps method name to local methods through action name."""
|
||||
@ -58,7 +54,7 @@ class JSONDictSerializer(DictSerializer):
|
||||
|
||||
def default(self, data):
|
||||
def sanitizer(obj):
|
||||
return six.text_type(obj)
|
||||
return str(obj)
|
||||
return jsonutils.dumps(data, default=sanitizer)
|
||||
|
||||
|
||||
@ -93,7 +89,7 @@ class XMLDictSerializer(DictSerializer):
|
||||
root_key = constants.VIRTUAL_ROOT_KEY
|
||||
root_value = None
|
||||
else:
|
||||
link_keys = [k for k in six.iterkeys(data) or []
|
||||
link_keys = [k for k in data.keys() or []
|
||||
if k.endswith('_links')]
|
||||
if link_keys:
|
||||
links = data.pop(link_keys[0], None)
|
||||
@ -183,10 +179,6 @@ class XMLDictSerializer(DictSerializer):
|
||||
result.set(
|
||||
constants.TYPE_ATTR,
|
||||
constants.TYPE_INT)
|
||||
elif isinstance(data, long):
|
||||
result.set(
|
||||
constants.TYPE_ATTR,
|
||||
constants.TYPE_LONG)
|
||||
elif isinstance(data, float):
|
||||
result.set(
|
||||
constants.TYPE_ATTR,
|
||||
@ -194,7 +186,7 @@ class XMLDictSerializer(DictSerializer):
|
||||
LOG.debug("Data %(data)s type is %(type)s",
|
||||
{'data': data,
|
||||
'type': type(data)})
|
||||
result.text = six.text_type(data)
|
||||
result.text = str(data)
|
||||
return result
|
||||
|
||||
def _create_link_nodes(self, xml_doc, links):
|
||||
@ -323,8 +315,6 @@ class XMLDeserializer(TextDeserializer):
|
||||
lambda x: x.lower() == 'true',
|
||||
constants.TYPE_INT:
|
||||
lambda x: int(x),
|
||||
constants.TYPE_LONG:
|
||||
lambda x: long(x),
|
||||
constants.TYPE_FLOAT:
|
||||
lambda x: float(x)}
|
||||
if attrType and attrType in converters:
|
||||
|
@ -24,7 +24,6 @@ import os
|
||||
from oslo_log import versionutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import importutils
|
||||
import six
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
from tackerclient.i18n import _
|
||||
@ -141,7 +140,7 @@ def http_log_resp(_logger, resp, body):
|
||||
|
||||
|
||||
def _safe_encode_without_obj(data):
|
||||
if isinstance(data, six.string_types):
|
||||
if isinstance(data, str):
|
||||
return encodeutils.safe_encode(data)
|
||||
return data
|
||||
|
||||
|
@ -25,6 +25,10 @@ import itertools
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from cliff import app
|
||||
from cliff import commandmanager
|
||||
|
||||
from keystoneclient.auth.identity import v2 as v2_auth
|
||||
from keystoneclient.auth.identity import v3 as v3_auth
|
||||
@ -33,11 +37,6 @@ from keystoneclient import exceptions as ks_exc
|
||||
from keystoneclient import session
|
||||
from oslo_utils import encodeutils
|
||||
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from cliff import app
|
||||
from cliff import commandmanager
|
||||
|
||||
from tackerclient.common import clientmanager
|
||||
from tackerclient.common import command as openstack_command
|
||||
from tackerclient.common import exceptions as exc
|
||||
|
@ -23,7 +23,6 @@ from cliff.formatters import table
|
||||
from cliff import lister
|
||||
from cliff import show
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from tackerclient.common._i18n import _
|
||||
from tackerclient.common import command
|
||||
@ -354,8 +353,7 @@ class TackerCommandMeta(abc.ABCMeta):
|
||||
name, bases, cls_dict)
|
||||
|
||||
|
||||
@six.add_metaclass(TackerCommandMeta)
|
||||
class TackerCommand(command.OpenStackCommand):
|
||||
class TackerCommand(command.OpenStackCommand, metaclass=TackerCommandMeta):
|
||||
|
||||
api = 'nfv-orchestration'
|
||||
values_specs = []
|
||||
|
@ -13,6 +13,7 @@
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
|
@ -20,7 +20,6 @@ from unittest import mock
|
||||
|
||||
import ddt
|
||||
from oslo_utils.fixture import uuidsentinel
|
||||
import six
|
||||
|
||||
from tackerclient.common import exceptions
|
||||
from tackerclient.osc import utils as tacker_osc_utils
|
||||
@ -448,7 +447,7 @@ class TestTerminateVnfLcm(TestVnfLcm):
|
||||
"delete vnf instance %(id)s"
|
||||
% {'timeout': 15, 'id': vnf_instance['id']})
|
||||
|
||||
self.assertIn(expected_message, six.text_type(result))
|
||||
self.assertIn(expected_message, str(result))
|
||||
self.assertNotCalled(mock_delete)
|
||||
|
||||
def test_terminate_no_options(self):
|
||||
|
@ -14,15 +14,13 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from unittest import mock
|
||||
import urllib
|
||||
|
||||
import contextlib
|
||||
import fixtures
|
||||
import six
|
||||
import io
|
||||
import sys
|
||||
import testtools
|
||||
|
||||
from unittest import mock
|
||||
import urllib
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from tackerclient.common import constants
|
||||
@ -41,7 +39,7 @@ ENDURL = 'localurl'
|
||||
|
||||
@contextlib.contextmanager
|
||||
def capture_std_streams():
|
||||
fake_stdout, fake_stderr = six.StringIO(), six.StringIO()
|
||||
fake_stdout, fake_stderr = io.StringIO(), io.StringIO()
|
||||
stdout, stderr = sys.stdout, sys.stderr
|
||||
try:
|
||||
sys.stdout, sys.stderr = fake_stdout, fake_stderr
|
||||
@ -318,7 +316,7 @@ class CLITestV10Base(testtools.TestCase):
|
||||
args.append("--tag")
|
||||
for tag in tags:
|
||||
args.append(tag)
|
||||
if isinstance(tag, six.string_types):
|
||||
if isinstance(tag, str):
|
||||
tag = urllib.quote(tag.encode('utf-8'))
|
||||
if query:
|
||||
query += "&tag=" + tag
|
||||
@ -415,7 +413,7 @@ class CLITestV10Base(testtools.TestCase):
|
||||
args.append("--tag")
|
||||
for tag in tags:
|
||||
args.append(tag)
|
||||
if isinstance(tag, six.string_types):
|
||||
if isinstance(tag, str):
|
||||
tag = urllib.quote(tag.encode('utf-8'))
|
||||
if query:
|
||||
query += "&tag=" + tag
|
||||
|
@ -14,18 +14,17 @@
|
||||
# under the License.
|
||||
|
||||
import argparse
|
||||
import fixtures
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
import sys
|
||||
|
||||
import fixtures
|
||||
from keystoneclient import session
|
||||
import testtools
|
||||
from testtools import matchers
|
||||
from unittest import mock
|
||||
|
||||
from keystoneclient import session
|
||||
|
||||
from tackerclient.common import clientmanager
|
||||
from tackerclient import shell as openstack_shell
|
||||
@ -63,8 +62,8 @@ class ShellTest(testtools.TestCase):
|
||||
clean_env = {}
|
||||
_old_env, os.environ = os.environ, clean_env.copy()
|
||||
try:
|
||||
sys.stdout = six.StringIO()
|
||||
sys.stderr = six.StringIO()
|
||||
sys.stdout = io.StringIO()
|
||||
sys.stderr = io.StringIO()
|
||||
_shell = openstack_shell.TackerShell(DEFAULT_API_VERSION)
|
||||
_shell.run(argstr.split())
|
||||
except SystemExit:
|
||||
|
@ -19,7 +19,6 @@ import logging
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from tackerclient import client
|
||||
|
Loading…
x
Reference in New Issue
Block a user