Remove six
We don't need this in a Python 3-only world Change-Id: I2f2cff3c291b5db53287a99b8044e162c2d8f47d
This commit is contained in:
parent
da3d40cb88
commit
a75a3f223b
@ -13,7 +13,6 @@
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import six
|
||||
import yaml
|
||||
|
||||
from kolla_cli.api.exceptions import InvalidArgument
|
||||
@ -66,8 +65,7 @@ class PropertyApi(object):
|
||||
# string to a property. without this safe_load will turn
|
||||
# an empty string into a None which is different than an
|
||||
# empty string.
|
||||
if isinstance(original_value, six.string_types)\
|
||||
and value is None:
|
||||
if isinstance(original_value, str) and value is None:
|
||||
value = ''
|
||||
if current_property.value is None:
|
||||
current_property_type = None
|
||||
|
@ -21,7 +21,6 @@ import yaml
|
||||
|
||||
from cliff.command import Command
|
||||
from cliff.lister import Lister
|
||||
from six.moves import input
|
||||
|
||||
from kolla_cli.api.client import ClientApi
|
||||
from kolla_cli.api.exceptions import ClientException
|
||||
|
@ -27,7 +27,7 @@ CLIENT = ClientApi()
|
||||
|
||||
def _get_names(args_list):
|
||||
csv_list = args_list[0].strip()
|
||||
names = utils.convert_to_unicode(csv_list).split(',')
|
||||
names = csv_list.split(',')
|
||||
if 'all' in names:
|
||||
names = None
|
||||
return names
|
||||
|
@ -18,7 +18,6 @@ import grp
|
||||
import logging
|
||||
import os
|
||||
import pwd
|
||||
import six
|
||||
import subprocess # nosec
|
||||
import time
|
||||
import yaml
|
||||
@ -121,17 +120,6 @@ def get_ansible_command(playbook=False):
|
||||
return cmd
|
||||
|
||||
|
||||
def convert_to_unicode(the_string):
|
||||
"""convert string to unicode.
|
||||
|
||||
This is used to fixup extended ascii chars in strings. these chars cause
|
||||
errors in json pickle/unpickle.
|
||||
"""
|
||||
if the_string is None:
|
||||
return the_string
|
||||
return six.u(the_string)
|
||||
|
||||
|
||||
def run_cmd(cmd, print_output=True):
|
||||
"""run a system command
|
||||
|
||||
@ -422,7 +410,7 @@ def safe_decode(obj_to_decode):
|
||||
new_obj[key] = value
|
||||
else:
|
||||
new_obj = obj_to_decode
|
||||
if not isinstance(obj_to_decode, six.text_type):
|
||||
if not isinstance(obj_to_decode, str):
|
||||
# object is not unicode
|
||||
new_obj = obj_to_decode.decode('utf-8')
|
||||
return new_obj
|
||||
@ -478,7 +466,7 @@ def check_arg(param, param_name, expected_type, none_ok=False, empty_ok=False,
|
||||
# None arg
|
||||
raise MissingArgument(param_name)
|
||||
|
||||
if ((isinstance(param, six.string_types) or
|
||||
if ((isinstance(param, str) or
|
||||
isinstance(param, dict) or
|
||||
isinstance(param, list)) and
|
||||
not param and not empty_ok):
|
||||
@ -488,9 +476,6 @@ def check_arg(param, param_name, expected_type, none_ok=False, empty_ok=False,
|
||||
# if expected type is None, skip the type checking
|
||||
if expected_type is None:
|
||||
return
|
||||
# normalize expected string types for py2 and py3
|
||||
if expected_type is str:
|
||||
expected_type = six.string_types
|
||||
|
||||
if not isinstance(param, expected_type):
|
||||
# wrong type
|
||||
|
@ -86,7 +86,6 @@ restructuredtext-lint==1.1.3
|
||||
rfc3986==1.2.0
|
||||
setuptools==21.0.0
|
||||
simplejson==3.13.2
|
||||
six==1.10.0
|
||||
smmap2==2.0.3
|
||||
snowballstemmer==1.2.1
|
||||
Sphinx==1.6.2
|
||||
|
@ -9,5 +9,4 @@ jsonpickle>=0.9 # BSD
|
||||
oslo.i18n>=3.20.0 # Apache-2.0
|
||||
paramiko>=2.6.0 # LGPL
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
six>=1.10.0 # MIT
|
||||
docker>=2.4.2 # Apache-2.0
|
||||
|
Loading…
Reference in New Issue
Block a user