Remove the six library
This commit removes the six library from the repo, as the only supported Python version is 3.9. Test Plan: PASS: Success on tox command. Story: 2011149 Task: 50395 Change-Id: I44942ba91791c3ea541c7642107b48e8b2b2d457 Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
This commit is contained in:
parent
b5cbd9480c
commit
5774a62cb4
22
.git-blame-ignore-revs
Normal file
22
.git-blame-ignore-revs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# git hyper-blame master ignore list.
|
||||||
|
#
|
||||||
|
# This file contains a list of git hashes of revisions to be ignored by git
|
||||||
|
# hyper-blame. These revisions are considered "unimportant" in that they are
|
||||||
|
# unlikely to be what you are interested in when blaming.
|
||||||
|
#
|
||||||
|
# Instructions:
|
||||||
|
# - Only large (generally automated) reformatting or renaming commits should be
|
||||||
|
# added to this list. Do not put things here just because you feel they are
|
||||||
|
# trivial or unimportant. If in doubt, do not put it on this list.
|
||||||
|
# - Precede each revision with a comment containing the first line of its log.
|
||||||
|
# For bulk work over many commits, place all commits in a block with a single
|
||||||
|
# comment at the top describing the work done in those commits.
|
||||||
|
# - Only put full 40-character hashes on this list (not short hashes or any
|
||||||
|
# other revision reference).
|
||||||
|
# - Append to the bottom of the file (revisions should be in chronological order
|
||||||
|
# from oldest to newest).
|
||||||
|
# - Because you must use a hash, you need to append to this list in a follow-up
|
||||||
|
# commit to the actual reformatting commit that you are trying to ignore.
|
||||||
|
|
||||||
|
# Format all Python files with Black formatter
|
||||||
|
b5cbd9480cef12fee05ae6cf68aaae5aaa931969
|
@ -92,7 +92,7 @@ ignore-mixin-members=yes
|
|||||||
# List of module names for which member attributes should not be checked
|
# List of module names for which member attributes should not be checked
|
||||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||||
# and thus existing member attributes cannot be deduced by static analysis
|
# and thus existing member attributes cannot be deduced by static analysis
|
||||||
ignored-modules=distutils,eventlet.green.subprocess,six,six.moves
|
ignored-modules=distutils,eventlet.green.subprocess
|
||||||
|
|
||||||
# List of classes names for which member attributes should not be checked
|
# List of classes names for which member attributes should not be checked
|
||||||
# (useful for classes with attributes dynamically set).
|
# (useful for classes with attributes dynamically set).
|
||||||
@ -224,4 +224,4 @@ valid-classmethod-first-arg=cls
|
|||||||
[EXCEPTIONS]
|
[EXCEPTIONS]
|
||||||
# Exceptions that will emit a warning when being caught. Defaults to
|
# Exceptions that will emit a warning when being caught. Defaults to
|
||||||
# "Exception"
|
# "Exception"
|
||||||
overgeneral-exceptions=Exception
|
overgeneral-exceptions=builtins.Exception
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import six
|
|
||||||
|
|
||||||
from dcmanagerclient.api.v1 import client as client_v1
|
from dcmanagerclient.api.v1 import client as client_v1
|
||||||
|
|
||||||
|
|
||||||
@ -39,7 +37,7 @@ def client(
|
|||||||
session=None,
|
session=None,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
if dcmanager_url and not isinstance(dcmanager_url, six.string_types):
|
if dcmanager_url and not isinstance(dcmanager_url, str):
|
||||||
raise RuntimeError("DC Manager url should be a string.")
|
raise RuntimeError("DC Manager url should be a string.")
|
||||||
|
|
||||||
return client_v1.Client(
|
return client_v1.Client(
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
import keystoneauth1.identity.generic as auth_plugin
|
import keystoneauth1.identity.generic as auth_plugin
|
||||||
import osprofiler.profiler
|
import osprofiler.profiler
|
||||||
import six
|
|
||||||
from keystoneauth1 import session as ks_session
|
from keystoneauth1 import session as ks_session
|
||||||
|
|
||||||
from dcmanagerclient.api import httpclient
|
from dcmanagerclient.api import httpclient
|
||||||
@ -74,7 +73,7 @@ class Client:
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""DC Manager communicates with Keystone to fetch necessary values."""
|
"""DC Manager communicates with Keystone to fetch necessary values."""
|
||||||
if dcmanager_url and not isinstance(dcmanager_url, six.string_types):
|
if dcmanager_url and not isinstance(dcmanager_url, str):
|
||||||
raise RuntimeError("DC Manager url should be a string.")
|
raise RuntimeError("DC Manager url should be a string.")
|
||||||
|
|
||||||
if auth_url or session:
|
if auth_url or session:
|
||||||
|
@ -18,12 +18,10 @@
|
|||||||
|
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
import six
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class DCManagerLister(command.Lister, metaclass=abc.ABCMeta):
|
||||||
class DCManagerLister(command.Lister):
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def _get_format_function(self):
|
def _get_format_function(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@ -52,8 +50,7 @@ class DCManagerLister(command.Lister):
|
|||||||
return f()
|
return f()
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class DCManagerShowOne(command.ShowOne, metaclass=abc.ABCMeta):
|
||||||
class DCManagerShowOne(command.ShowOne):
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def _get_format_function(self):
|
def _get_format_function(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
@ -83,8 +80,7 @@ class DCManagerShowOne(command.ShowOne):
|
|||||||
return f()
|
return f()
|
||||||
|
|
||||||
|
|
||||||
@six.add_metaclass(abc.ABCMeta)
|
class DCManagerShow(DCManagerLister, DCManagerShowOne, metaclass=abc.ABCMeta):
|
||||||
class DCManagerShow(DCManagerLister, DCManagerShowOne):
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def should_list(self, parsed_args):
|
def should_list(self, parsed_args):
|
||||||
"""Uses Lister behaviour if True, ShowOne otherwise."""
|
"""Uses Lister behaviour if True, ShowOne otherwise."""
|
||||||
|
@ -18,7 +18,6 @@ import base64
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from osc_lib.command import command
|
from osc_lib.command import command
|
||||||
import six
|
|
||||||
|
|
||||||
from dcmanagerclient import exceptions
|
from dcmanagerclient import exceptions
|
||||||
from dcmanagerclient import utils
|
from dcmanagerclient import utils
|
||||||
@ -907,7 +906,7 @@ class RedeploySubcloud(base.DCManagerShowOne):
|
|||||||
"WARNING: This will redeploy the subcloud. "
|
"WARNING: This will redeploy the subcloud. "
|
||||||
"All applications and data on the subcloud will be lost."
|
"All applications and data on the subcloud will be lost."
|
||||||
)
|
)
|
||||||
confirm = six.moves.input('Please type "redeploy" to confirm: ').strip().lower()
|
confirm = input('Please type "redeploy" to confirm: ').strip().lower()
|
||||||
if confirm == "redeploy":
|
if confirm == "redeploy":
|
||||||
try:
|
try:
|
||||||
return subcloud_manager.redeploy_subcloud(
|
return subcloud_manager.redeploy_subcloud(
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import io
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import six
|
|
||||||
import testtools
|
import testtools
|
||||||
|
|
||||||
from dcmanagerclient import shell
|
from dcmanagerclient import shell
|
||||||
@ -31,8 +31,8 @@ class BaseShellTests(testtools.TestCase):
|
|||||||
_old_env, os.environ = os.environ, clean_env.copy()
|
_old_env, os.environ = os.environ, clean_env.copy()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sys.stdout = six.moves.cStringIO()
|
sys.stdout = io.StringIO()
|
||||||
sys.stderr = six.moves.cStringIO()
|
sys.stderr = io.StringIO()
|
||||||
_shell = shell.DCManagerShell()
|
_shell = shell.DCManagerShell()
|
||||||
_shell.run(argstr.split())
|
_shell.run(argstr.split())
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
@ -387,7 +387,7 @@ class TestCLISubcloudManagerV1(base.BaseCommandTest):
|
|||||||
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
||||||
|
|
||||||
@mock.patch("getpass.getpass", return_value="testpassword")
|
@mock.patch("getpass.getpass", return_value="testpassword")
|
||||||
@mock.patch("six.moves.input", return_value="redeploy")
|
@mock.patch.object(subcloud_cmd, "input", return_value="redeploy")
|
||||||
def test_redeploy_subcloud(self, _mock_input, _mock_getpass):
|
def test_redeploy_subcloud(self, _mock_input, _mock_getpass):
|
||||||
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
||||||
self.subcloud_resource
|
self.subcloud_resource
|
||||||
@ -421,7 +421,7 @@ class TestCLISubcloudManagerV1(base.BaseCommandTest):
|
|||||||
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
||||||
|
|
||||||
@mock.patch("getpass.getpass", return_value="testpassword")
|
@mock.patch("getpass.getpass", return_value="testpassword")
|
||||||
@mock.patch("six.moves.input", return_value="redeploy")
|
@mock.patch.object(subcloud_cmd, "input", return_value="redeploy")
|
||||||
def test_redeploy_subcloud_no_parameters(self, _mock_input, _mock_getpass):
|
def test_redeploy_subcloud_no_parameters(self, _mock_input, _mock_getpass):
|
||||||
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
||||||
self.subcloud_resource
|
self.subcloud_resource
|
||||||
@ -430,7 +430,7 @@ class TestCLISubcloudManagerV1(base.BaseCommandTest):
|
|||||||
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
self.assertEqual(base.SUBCLOUD_FIELD_RESULT_LIST_WITH_PEERID, actual_call[1])
|
||||||
|
|
||||||
@mock.patch("getpass.getpass", return_value="testpassword")
|
@mock.patch("getpass.getpass", return_value="testpassword")
|
||||||
@mock.patch("six.moves.input", return_value="redeploy")
|
@mock.patch.object(subcloud_cmd, "input", return_value="redeploy")
|
||||||
def test_redeploy_bootstrap_files_does_not_exists(self, _mock_input, _mock_getpass):
|
def test_redeploy_bootstrap_files_does_not_exists(self, _mock_input, _mock_getpass):
|
||||||
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
self.client.subcloud_manager.redeploy_subcloud.return_value = [
|
||||||
self.subcloud_resource
|
self.subcloud_resource
|
||||||
|
@ -11,4 +11,3 @@ python-keystoneclient>=3.8.0 # Apache-2.0
|
|||||||
PyYAML>=3.10.0 # MIT
|
PyYAML>=3.10.0 # MIT
|
||||||
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
|
requests!=2.12.2,!=2.13.0,>=2.10.0 # Apache-2.0
|
||||||
requests-toolbelt # Apache-2.0
|
requests-toolbelt # Apache-2.0
|
||||||
six>=1.9.0 # MIT
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user