Merge "Remove all usage of six library"
This commit is contained in:
commit
b092ae861b
|
@ -99,7 +99,6 @@ requestsexceptions==1.2.0
|
|||
rfc3986==0.3.1
|
||||
Routes==2.3.1
|
||||
simplejson==3.5.1
|
||||
six==1.10.0
|
||||
snowballstemmer==1.2.1
|
||||
Sphinx==1.8.0
|
||||
sphinxcontrib-websupport==1.0.1
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
import six
|
||||
import urllib
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from keystoneauth1 import exceptions
|
||||
|
||||
urlparse = six.moves.urllib.parse
|
||||
urlparse = urllib.parse
|
||||
|
||||
|
||||
class Resource(object):
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# limitations under the License.
|
||||
|
||||
import copy
|
||||
import six
|
||||
|
||||
from oslo_utils import importutils
|
||||
|
||||
|
@ -48,7 +47,7 @@ class Client(object):
|
|||
mistral_url = req.get('mistral_url')
|
||||
profile = req.get('profile')
|
||||
|
||||
if mistral_url and not isinstance(mistral_url, six.string_types):
|
||||
if mistral_url and not isinstance(mistral_url, str):
|
||||
raise RuntimeError('Mistral url should be a string.')
|
||||
|
||||
# If auth url was provided then we perform an authentication, otherwise
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import six
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
|
@ -26,7 +25,7 @@ class Environment(base.Resource):
|
|||
def _set_attributes(self):
|
||||
"""Override loading of the "variables" attribute from text to dict."""
|
||||
for k, v in self._data.items():
|
||||
if k == 'variables' and isinstance(v, six.string_types):
|
||||
if k == 'variables' and isinstance(v, str):
|
||||
v = jsonutils.loads(v)
|
||||
|
||||
try:
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import six
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
|
@ -51,7 +50,7 @@ class ExecutionManager(base.ResourceManager):
|
|||
data.update({'workflow_namespace': namespace})
|
||||
|
||||
if workflow_input:
|
||||
if isinstance(workflow_input, six.string_types):
|
||||
if isinstance(workflow_input, str):
|
||||
data.update({'input': workflow_input})
|
||||
else:
|
||||
data.update({'input': jsonutils.dumps(workflow_input)})
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
import abc
|
||||
|
||||
import six
|
||||
from stevedore import driver
|
||||
|
||||
|
||||
|
@ -28,8 +27,7 @@ def get_auth_handler(auth_type):
|
|||
return mgr.driver
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class AuthHandler(object):
|
||||
class AuthHandler(metaclass=abc.ABCMeta):
|
||||
"""Abstract base class for an authentication plugin."""
|
||||
|
||||
@abc.abstractmethod
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
import logging
|
||||
import os
|
||||
import pprint
|
||||
import urllib
|
||||
|
||||
import requests
|
||||
from six.moves import urllib
|
||||
|
||||
from mistralclient import auth
|
||||
|
||||
|
|
|
@ -19,14 +19,12 @@ import datetime as dt
|
|||
import textwrap
|
||||
|
||||
from osc_lib.command import command
|
||||
import six
|
||||
|
||||
|
||||
DEFAULT_LIMIT = 100
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class MistralFormatter(object):
|
||||
class MistralFormatter(metaclass=abc.ABCMeta):
|
||||
COLUMNS = []
|
||||
|
||||
@classmethod
|
||||
|
@ -51,8 +49,7 @@ class MistralFormatter(object):
|
|||
pass
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class MistralLister(command.Lister):
|
||||
class MistralLister(command.Lister, metaclass=abc.ABCMeta):
|
||||
@abc.abstractmethod
|
||||
def _get_format_function(self):
|
||||
raise NotImplementedError
|
||||
|
@ -125,8 +122,7 @@ class MistralLister(command.Lister):
|
|||
return f()
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
class MistralExecutionLister(MistralLister):
|
||||
class MistralExecutionLister(MistralLister, metaclass=abc.ABCMeta):
|
||||
def get_parser(self, parsed_args):
|
||||
parser = super(MistralExecutionLister, self).get_parser(parsed_args)
|
||||
parser.set_defaults(limit=DEFAULT_LIMIT)
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import io
|
||||
import os
|
||||
import sys
|
||||
|
||||
from oslotest import base
|
||||
import six
|
||||
|
||||
from mistralclient import shell
|
||||
|
||||
|
@ -29,8 +29,8 @@ class BaseShellTests(base.BaseTestCase):
|
|||
_old_env, os.environ = os.environ, clean_env.copy()
|
||||
|
||||
try:
|
||||
sys.stdout = six.moves.cStringIO()
|
||||
sys.stderr = six.moves.cStringIO()
|
||||
sys.stdout = io.StringIO()
|
||||
sys.stderr = io.StringIO()
|
||||
_shell = shell.MistralShell()
|
||||
_shell.run(argstr.split())
|
||||
except SystemExit:
|
||||
|
|
|
@ -16,7 +16,7 @@ import base64
|
|||
import copy
|
||||
from unittest import mock
|
||||
|
||||
from six.moves.urllib import parse as urlparse
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from oslo_utils import uuidutils
|
||||
from osprofiler import _utils as osprofiler_utils
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
import os.path
|
||||
import pkg_resources as pkg
|
||||
from six.moves.urllib import parse
|
||||
from six.moves.urllib import request
|
||||
from urllib import parse
|
||||
from urllib import request
|
||||
|
||||
from mistralclient.api import base as api_base
|
||||
from mistralclient.api.v2 import actions
|
||||
|
|
|
@ -15,12 +15,10 @@
|
|||
#
|
||||
|
||||
import copy
|
||||
import io
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from mistralclient.api.v2 import action_executions as action_ex
|
||||
|
@ -162,7 +160,7 @@ class TestCLIActionExecutions(base.BaseCommandTest):
|
|||
|
||||
# Redirect the stderr so it doesn't show during tox
|
||||
_stderr = sys.stderr
|
||||
sys.stderr = six.StringIO()
|
||||
sys.stderr = io.StringIO()
|
||||
|
||||
for state in states:
|
||||
self.assertRaises(
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from mistralclient.api.v2 import actions
|
||||
from mistralclient.commands.v2 import actions as action_cmd
|
||||
|
@ -90,7 +89,7 @@ class TestCLIActionsV2(base.BaseCommandTest):
|
|||
def test_create_long_input(self, mock_open):
|
||||
action_long_input_dict = ACTION_DICT.copy()
|
||||
long_input = ', '.join(
|
||||
['var%s' % i for i in six.moves.xrange(10)]
|
||||
['var%s' % i for i in range(10)]
|
||||
)
|
||||
action_long_input_dict['input'] = long_input
|
||||
workflow_long_input = actions.Action(
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
from unittest import mock
|
||||
|
||||
import six
|
||||
|
||||
from mistralclient.api.v2 import workflows
|
||||
from mistralclient.commands.v2 import base as cmd_base
|
||||
|
@ -90,7 +89,7 @@ class TestCLIWorkflowsV2(base.BaseCommandTest):
|
|||
def test_create_long_input(self, mock_open):
|
||||
wf_long_input_dict = WORKFLOW_DICT.copy()
|
||||
long_input = ', '.join(
|
||||
['var%s' % i for i in six.moves.xrange(10)]
|
||||
['var%s' % i for i in range(10)]
|
||||
)
|
||||
wf_long_input_dict['input'] = long_input
|
||||
workflow_long_input = workflows.Workflow(mock, wf_long_input_dict)
|
||||
|
|
|
@ -19,8 +19,8 @@ import os.path
|
|||
from oslo_serialization import jsonutils
|
||||
|
||||
import pkg_resources as pkg
|
||||
from six.moves.urllib import parse
|
||||
from six.moves.urllib import request
|
||||
from urllib import parse
|
||||
from urllib import request
|
||||
|
||||
from mistralclient.api import base as api_base
|
||||
from mistralclient.api.v2 import environments
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
import os.path
|
||||
import pkg_resources as pkg
|
||||
from six.moves.urllib import parse
|
||||
from six.moves.urllib import request
|
||||
from urllib import parse
|
||||
from urllib import request
|
||||
|
||||
from mistralclient.api import base as api_base
|
||||
from mistralclient.api.v2 import workbooks
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
|
||||
import os.path
|
||||
import pkg_resources as pkg
|
||||
from six.moves.urllib import parse
|
||||
from six.moves.urllib import request
|
||||
from urllib import parse
|
||||
from urllib import request
|
||||
|
||||
from mistralclient.api.v2 import workflows
|
||||
from mistralclient.tests.unit.v2 import base
|
||||
|
|
|
@ -18,8 +18,8 @@ import yaml
|
|||
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from six.moves.urllib import parse
|
||||
from six.moves.urllib import request
|
||||
from urllib import parse
|
||||
from urllib import request
|
||||
|
||||
from mistralclient import exceptions
|
||||
|
||||
|
|
|
@ -10,5 +10,4 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
|||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
PyYAML>=3.12 # MIT
|
||||
requests>=2.14.2 # Apache-2.0
|
||||
six>=1.10.0 # MIT
|
||||
stevedore>=1.20.0 # Apache-2.0
|
||||
|
|
Loading…
Reference in New Issue